geospatial 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/geospatial/location.rb +1 -1
- data/lib/geospatial/version.rb +1 -1
- data/spec/geospatial/location_spec.rb +18 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ee2c24c3dbccd264f68b61b60ac34e96a6fa7c1
|
4
|
+
data.tar.gz: 9b08372743682db4ec05e6b4d7e27913ab0d5f87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0c6c0d19786014b9f6cb5da18e31a2c00c4248240326e1b1a28870e6b80a0f903ad75781a0b2553ed7c1420bd1590db43fb9fb1124ce8fcc335763ef77509ba
|
7
|
+
data.tar.gz: aafcf7bfeb1171e973f86844ae8d87a8f94104f94cbe733bb0762890aa1c59aa205260a984e4e0cf54b55f6a963e2b401cd5eb6b53416c2eb49259bbaef7cbe1
|
data/lib/geospatial/location.rb
CHANGED
data/lib/geospatial/version.rb
CHANGED
@@ -20,17 +20,23 @@
|
|
20
20
|
|
21
21
|
require 'geospatial/location'
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
expect("#{lake_alex}").to be == "Geospatial::Location[170.45, -43.94]"
|
34
|
-
end
|
23
|
+
RSpec.describe Geospatial::Location do
|
24
|
+
let(:lake_tekapo) {Geospatial::Location.new(170.53, -43.89)}
|
25
|
+
let(:lake_alex) {Geospatial::Location.new(170.45, -43.94)}
|
26
|
+
|
27
|
+
it "compute the correct distance between two points" do
|
28
|
+
expect(lake_alex.distance_from(lake_tekapo)).to be_within(100).of(8_500)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should format nicely" do
|
32
|
+
expect("#{lake_alex}").to be == "Geospatial::Location[170.45, -43.94]"
|
35
33
|
end
|
36
34
|
end
|
35
|
+
|
36
|
+
require 'bigdecimal'
|
37
|
+
|
38
|
+
RSpec.describe Geospatial::Location[BigDecimal.new("170.45"), BigDecimal.new("-43.94")] do
|
39
|
+
it "should format nicely" do
|
40
|
+
expect("#{subject}").to be == "Geospatial::Location[170.45, -43.94]"
|
41
|
+
end
|
42
|
+
end
|