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