From fd214c85fd7df3f1a84b49cd7b0c45eafee59c6b Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Sun, 6 Mar 2011 12:17:14 -0500 Subject: [PATCH] Split test into two (for clarity). --- test/geocoder_test.rb | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/test/geocoder_test.rb b/test/geocoder_test.rb index 9e92d068..88a93ea4 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 --- -- GitLab