Skip to content

Commit

Permalink
Add test for nautical miles distance calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreisner committed Apr 3, 2013
1 parent 7ea4585 commit 8458792
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/calculations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---

Expand Down

0 comments on commit 8458792

Please sign in to comment.