diff --git a/test/geocoder_test.rb b/test/geocoder_test.rb index 9e92d068ba6eb1451819aee0a95504a4555fd0ce..88a93ea45c71b5b668c427fc69004e62ad114f42 100644 --- a/test/geocoder_test.rb +++ b/test/geocoder_test.rb @@ -27,6 +27,18 @@ class GeocoderTest < Test::Unit::TestCase end end + def test_distance_to_returns_float + v = Venue.new(*venue_params(:msg)) + v.latitude, v.longitude = [40.750354, -73.993371] + assert (d = v.distance_to(30, -94)).is_a?(Float) + end + + def test_distance_from_is_alias_for_distance_to + v = Venue.new(*venue_params(:msg)) + v.latitude, v.longitude = [40.750354, -73.993371] + assert_equal v.distance_from(30, -94), v.distance_to(30, -94) + end + # --- general --- @@ -57,15 +69,6 @@ class GeocoderTest < Test::Unit::TestCase assert_equal "US", e.country end - def test_distance_to_returns_float - v = Venue.new(*venue_params(:msg)) - v.latitude = 40.750354 - v.longitude = -73.993371 - assert (d = v.distance_to(30, -94)).is_a?(Float) - # make sure distance_from is an alias - assert_equal d, v.distance_from(30, -94) - end - # --- Google ---