From 8458792fcb17c45a0817c960216982e75e8ff94b Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Wed, 3 Apr 2013 13:32:27 -0400 Subject: [PATCH] Add test for nautical miles distance calculation. --- test/calculations_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/calculations_test.rb b/test/calculations_test.rb index 104d237f..f8d1ee33 100644 --- a/test/calculations_test.rb +++ b/test/calculations_test.rb @@ -38,6 +38,12 @@ class CalculationsTest < Test::Unit::TestCase 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 --- -- GitLab