simple-trail 0.0.3 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Manipulation::Enricher do
6
+ it 'nothing to enrich' do
7
+ parser = Parser::Gpx.new('./spec/examples/test_1.gpx')
8
+ parser.read
9
+
10
+ point_count = parser.points.count
11
+ enrichement_logic = described_class.new(parser.points)
12
+ enrichement_logic.enrich
13
+
14
+ expect(enrichement_logic.enriched_points.count).to eq point_count
15
+ end
16
+
17
+ it 'something to enrich' do
18
+ parser = Parser::Gpx.new('./spec/examples/zyleta2021.gpx')
19
+ parser.read
20
+
21
+ point_count = parser.points.count
22
+ enrichement_logic = described_class.new(parser.points)
23
+ enrichement_logic.enrich
24
+
25
+ expect(enrichement_logic.enriched_points.count).not_to eq point_count
26
+ end
27
+
28
+ it 'something more to enrich' do
29
+ parser = Parser::Gpx.new('./spec/examples/gss20-full-official.gpx')
30
+ parser.read
31
+
32
+ point_count = parser.points.count
33
+ enrichement_logic = described_class.new(parser.points, 0.1)
34
+ enrichement_logic.enrich
35
+
36
+ expect(enrichement_logic.enriched_points.count).not_to eq point_count
37
+ expect(enrichement_logic.enriched_points.all?{|point| !point[:ele].nil?}).to be(true)
38
+ end
39
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Parser::Gpx do
4
+ it 'reads poi' do
5
+ gpx_parser = described_class.new('./spec/examples/pois.gpx')
6
+ expect { gpx_parser.read }.not_to raise_error
7
+ expect(gpx_parser.points_of_interests.size).to eq 6
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Staszek Zawadzki
@@ -76,12 +76,15 @@ files:
76
76
  - README.md
77
77
  - install.sh
78
78
  - lib/simple_trail.rb
79
+ - lib/simple_trail/manipulation/enricher.rb
79
80
  - lib/simple_trail/manipulation/statistics.rb
80
81
  - lib/simple_trail/manipulation/straightener.rb
81
82
  - lib/simple_trail/manipulation/unifier.rb
82
83
  - lib/simple_trail/parser/gpx.rb
83
84
  - simple-trail.gemspec
85
+ - spec/examples/gss20-full-official.gpx
84
86
  - spec/examples/kbl.gpx
87
+ - spec/examples/pois.gpx
85
88
  - spec/examples/test-xxl.gpx
86
89
  - spec/examples/test_1.gpx
87
90
  - spec/examples/test_10.gpx
@@ -96,9 +99,12 @@ files:
96
99
  - spec/examples/test_8.gpx
97
100
  - spec/examples/test_9.gpx
98
101
  - spec/examples/test_with_segments.gpx
102
+ - spec/examples/zyleta2021.gpx
103
+ - spec/manipulation/enricher_spec.rb
99
104
  - spec/manipulation/statistics_spec.rb
100
105
  - spec/manipulation/straightener_spec.rb
101
106
  - spec/manipulation/unifier_spec.rb
107
+ - spec/parser/gpx_poi_spec.rb
102
108
  - spec/parser/gpx_spec.rb
103
109
  - spec/spec_helper.rb
104
110
  homepage:
@@ -120,12 +126,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
126
  - !ruby/object:Gem::Version
121
127
  version: '0'
122
128
  requirements: []
123
- rubygems_version: 3.0.8
129
+ rubygems_version: 3.1.4
124
130
  signing_key:
125
131
  specification_version: 4
126
132
  summary: Readind and manipulating GPX and other trail representation file
127
133
  test_files:
134
+ - spec/examples/gss20-full-official.gpx
128
135
  - spec/examples/kbl.gpx
136
+ - spec/examples/pois.gpx
129
137
  - spec/examples/test-xxl.gpx
130
138
  - spec/examples/test_1.gpx
131
139
  - spec/examples/test_10.gpx
@@ -140,8 +148,11 @@ test_files:
140
148
  - spec/examples/test_8.gpx
141
149
  - spec/examples/test_9.gpx
142
150
  - spec/examples/test_with_segments.gpx
151
+ - spec/examples/zyleta2021.gpx
152
+ - spec/manipulation/enricher_spec.rb
143
153
  - spec/manipulation/statistics_spec.rb
144
154
  - spec/manipulation/straightener_spec.rb
145
155
  - spec/manipulation/unifier_spec.rb
156
+ - spec/parser/gpx_poi_spec.rb
146
157
  - spec/parser/gpx_spec.rb
147
158
  - spec/spec_helper.rb