Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test for nautical miles distance calculation.

  • Loading branch information...
commit 8458792fcb17c45a0817c960216982e75e8ff94b 1 parent 7ea4585
@alexreisner authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/calculations_test.rb
View
6 test/calculations_test.rb
@@ -38,6 +38,12 @@ def test_distance_between_in_kilometers
assert (la_to_ny - 3942).abs < 10
end
+ def test_distance_between_in_nautical_miles
+ assert_equal 60, Geocoder::Calculations.distance_between([0,0], [0,1], :units => :nm).round
+ la_to_ny = Geocoder::Calculations.distance_between([34.05,-118.25], [40.72,-74], :units => :nm).round
+ assert (la_to_ny - 2124).abs < 10
+ end
+
# --- geographic center ---
Please sign in to comment.
Something went wrong with that request. Please try again.