Skip to content
Snippets Groups Projects
Commit 7aa17373 authored by Alex Reisner's avatar Alex Reisner
Browse files

Fix "ambiguous first argument" warnings.

parent 8977ed2c
Branches
Tags
No related merge requests found
......@@ -18,7 +18,7 @@ class LoggerTest < GeocoderTestCase
def test_set_logger_logs
assert_equal nil, Geocoder.log(:warn, "should log")
assert_match /should log\n$/, @tempfile.read
assert_match(/should log\n$/, @tempfile.read)
end
def test_logger_does_not_log_severity_too_low
......@@ -30,7 +30,7 @@ class LoggerTest < GeocoderTestCase
def test_logger_logs_when_severity_high_enough
@logger.level = Logger::DEBUG
Geocoder.log(:warn, "important: should log!")
assert_match /important: should log/, @tempfile.read
assert_match(/important: should log/, @tempfile.read)
end
def test_kernel_logger_does_not_log_severity_too_low
......
......@@ -29,7 +29,7 @@ class GeocodioTest < GeocoderTestCase
def test_geocodio_reverse_url
query = Geocoder::Query.new([45.423733, -75.676333])
assert_match /reverse/, query.url
assert_match(/reverse/, query.url)
end
def test_raises_invalid_request_exception
......
......@@ -20,7 +20,7 @@ class Geoip2Test < GeocoderTestCase
assert_equal 'US', result.country_code
assert_equal '94043', result.postal_code
assert_equal 37.41919999999999, result.latitude
assert_equal -122.0574, result.longitude
assert_equal(-122.0574, result.longitude)
assert_equal [37.41919999999999, -122.0574], result.coordinates
end
......
......@@ -89,6 +89,6 @@ class GoogleTest < GeocoderTestCase
def test_google_uses_https_when_api_key_is_set
Geocoder.configure(api_key: "deadbeef")
query = Geocoder::Query.new("Madison Square Garden, New York, NY")
assert_match /^https:/, query.url
assert_match(/^https:/, query.url)
end
end
......@@ -6,12 +6,12 @@ class IpinfoIoTest < GeocoderTestCase
def test_ipinfo_io_use_http_without_token
Geocoder.configure(:ip_lookup => :ipinfo_io, :use_https => true)
query = Geocoder::Query.new("8.8.8.8")
assert_match /^http:/, query.url
assert_match(/^http:/, query.url)
end
def test_ipinfo_io_uses_https_when_auth_token_set
Geocoder.configure(:ip_lookup => :ipinfo_io, :api_key => "FOO_BAR_TOKEN", :use_https => true)
query = Geocoder::Query.new("8.8.8.8")
assert_match /^https:/, query.url
assert_match(/^https:/, query.url)
end
end
......@@ -29,7 +29,7 @@ class LatlonTest < GeocoderTestCase
def test_latlon_reverse_url
query = Geocoder::Query.new([45.423733, -75.676333])
assert_match /reverse_geocode/, query.url
assert_match(/reverse_geocode/, query.url)
end
def test_raises_api_key_exception
......
......@@ -15,8 +15,8 @@ class MaxmindGeoip2Test < GeocoderTestCase
assert_equal 'United States', result.country
assert_equal 'US', result.country_code
assert_equal '90001', result.postal_code
assert_equal 37.6293, result.latitude
assert_equal -122.1163, result.longitude
assert_equal(37.6293, result.latitude)
assert_equal(-122.1163, result.longitude)
assert_equal [37.6293, -122.1163], result.coordinates
end
......
......@@ -15,8 +15,8 @@ class MaxmindLocalTest < GeocoderTestCase
assert_equal 'United States', result.country
assert_equal 'US', result.country_code
assert_equal '94043', result.postal_code
assert_equal 37.41919999999999, result.latitude
assert_equal -122.0574, result.longitude
assert_equal(37.41919999999999, result.latitude)
assert_equal(-122.0574, result.longitude)
assert_equal [37.41919999999999, -122.0574], result.coordinates
end
......
......@@ -11,7 +11,7 @@ class OpencagedataTest < GeocoderTestCase
def test_result_components
result = Geocoder.search("Madison Square Garden, New York, NY").first
assert_equal "West 31st Street", result.street
assert_match /46, West 31st Street, Koreatown, New York County, 10011, New York City, New York, United States of America/, result.address
assert_match(/46, West 31st Street, Koreatown, New York County, 10011, New York City, New York, United States of America/, result.address)
end
......@@ -39,7 +39,7 @@ class OpencagedataTest < GeocoderTestCase
def test_opencagedata_reverse_url
query = Geocoder::Query.new([45.423733, -75.676333])
assert_match /\bq=45.423733%2C-75.676333\b/, query.url
assert_match(/\bq=45.423733%2C-75.676333\b/, query.url)
end
......
......@@ -11,22 +11,22 @@ class SmartyStreetsTest < GeocoderTestCase
def test_url_contains_api_key
Geocoder.configure(:smarty_streets => {:api_key => 'blah'})
query = Geocoder::Query.new("Bluffton, SC")
assert_match /auth-token=blah/, query.url
assert_match(/auth-token=blah/, query.url)
end
def test_query_for_address_geocode
query = Geocoder::Query.new("42 Wallaby Way Sydney, AU")
assert_match /api\.smartystreets\.com\/street-address\?/, query.url
assert_match(/api\.smartystreets\.com\/street-address\?/, query.url)
end
def test_query_for_zipcode_geocode
query = Geocoder::Query.new("22204")
assert_match /api\.smartystreets\.com\/zipcode\?/, query.url
assert_match(/api\.smartystreets\.com\/zipcode\?/, query.url)
end
def test_query_for_zipfour_geocode
query = Geocoder::Query.new("22204-1603")
assert_match /api\.smartystreets\.com\/zipcode\?/, query.url
assert_match(/api\.smartystreets\.com\/zipcode\?/, query.url)
end
def test_smarty_streets_result_components
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment