test/test_bounds.rb in geokit-1.3.2 vs test/test_bounds.rb in geokit-1.4.0
- old
+ new
@@ -69,6 +69,29 @@
outside=Geokit::LatLng.new 32.8951550000,-96.9584440000
assert bounds.contains?(inside)
assert !bounds.contains?(outside)
end
+ def test_bounds_to_span
+ sw = Geokit::LatLng.new(32, -96)
+ ne = Geokit::LatLng.new(40, -70)
+ bounds = Geokit::Bounds.new(sw, ne)
+
+ assert_equal Geokit::LatLng.new(8, 26), bounds.to_span
+ end
+
+ def test_bounds_to_span_with_bounds_crossing_prime_meridian
+ sw = Geokit::LatLng.new(20, -70)
+ ne = Geokit::LatLng.new(40, 100)
+ bounds = Geokit::Bounds.new(sw, ne)
+
+ assert_equal Geokit::LatLng.new(20, 170), bounds.to_span
+ end
+
+ def test_bounds_to_span_with_bounds_crossing_dateline
+ sw = Geokit::LatLng.new(20, 100)
+ ne = Geokit::LatLng.new(40, -70)
+ bounds = Geokit::Bounds.new(sw, ne)
+
+ assert_equal Geokit::LatLng.new(20, 190), bounds.to_span
+ end
end
\ No newline at end of file