Skip to content

Commit

Permalink
Remove duplicate helper (defined in test_base_geocoder.rb)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnoack committed May 1, 2016
1 parent 23f71f9 commit 4448275
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions test/helper.rb
Expand Up @@ -80,36 +80,3 @@ def assert_array_in_delta(expected_array, actual_array, delta = 0.001, message =
],
}
end

# Base class for testing geocoders.
class BaseGeocoderTest < Test::Unit::TestCase #:nodoc: all
class Geokit::Geocoders::TestGeocoder < Geokit::Geocoders::Geocoder
def self.do_get(url)
sleep(2)
end
end

# Defines common test fixtures.
def setup
Geokit::Geocoders.request_timeout = 10
@address = "San Francisco, CA"
@full_address = "100 Spear St, San Francisco, CA, 94105-1522, US"
@full_address_short_zip = "100 Spear St, San Francisco, CA, 94105, US"

@latlng = Geokit::LatLng.new(37.7742, -122.417068)
@success = Geokit::GeoLoc.new({city: "SAN FRANCISCO", state: "CA", country_code: "US", lat: @latlng.lat, lng: @latlng.lng})
@success.success = true
end

def test_timeout_call_web_service
url = "http://www.anything.com"
Geokit::Geocoders.request_timeout = 1
assert_nil Geokit::Geocoders::TestGeocoder.call_geocoder_service(url)
end

def test_successful_call_web_service
url = "http://www.anything.com"
Geokit::Geocoders::Geocoder.expects(:do_get).with(url).returns("SUCCESS")
assert_equal "SUCCESS", Geokit::Geocoders::Geocoder.call_geocoder_service(url)
end
end

0 comments on commit 4448275

Please sign in to comment.