diff --git a/test/unit/logger_test.rb b/test/unit/logger_test.rb index 01efefa117f332281d597d82393b4f601035fda1..c018ee12ac39eb3d5464155735d7d3002e83b976 100644 --- a/test/unit/logger_test.rb +++ b/test/unit/logger_test.rb @@ -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 diff --git a/test/unit/lookups/geocodio_test.rb b/test/unit/lookups/geocodio_test.rb index 43e44f4b9305e8513a6c3ec4cd523640e9b2b899..6b316be9825d9e726e87d9f7f9dd28664bb50082 100644 --- a/test/unit/lookups/geocodio_test.rb +++ b/test/unit/lookups/geocodio_test.rb @@ -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 diff --git a/test/unit/lookups/geoip2_test.rb b/test/unit/lookups/geoip2_test.rb index 46f2b476112e0cf30d46e4d8ad2a64affcbb7a17..d50e3bce67e866355c46cf1ad9bab126c7042745 100644 --- a/test/unit/lookups/geoip2_test.rb +++ b/test/unit/lookups/geoip2_test.rb @@ -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 diff --git a/test/unit/lookups/google_test.rb b/test/unit/lookups/google_test.rb index 867508e1901237812804abc2ceefc7aef7e4f059..d658a82745c980de185d4dfca0ffded0b3adc2e5 100644 --- a/test/unit/lookups/google_test.rb +++ b/test/unit/lookups/google_test.rb @@ -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 diff --git a/test/unit/lookups/ipinfo_io_test.rb b/test/unit/lookups/ipinfo_io_test.rb index 4c3eccdecdb6c635b20d4611dc654212fbd5e119..379f383814a7659b261b76facc4264219d1d8acd 100644 --- a/test/unit/lookups/ipinfo_io_test.rb +++ b/test/unit/lookups/ipinfo_io_test.rb @@ -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 diff --git a/test/unit/lookups/latlon_test.rb b/test/unit/lookups/latlon_test.rb index 2dcb47a9bbe289d66f38b44d0992428726d88bd1..49ca664297001a0cdfc74ab42010dd01a6458fab 100644 --- a/test/unit/lookups/latlon_test.rb +++ b/test/unit/lookups/latlon_test.rb @@ -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 diff --git a/test/unit/lookups/maxmind_geoip2_test.rb b/test/unit/lookups/maxmind_geoip2_test.rb index 35235cbcf851ed44a632c4d60ddf260757a7dc28..a930a20137010f078e3e2060a611a2a132cedfaf 100644 --- a/test/unit/lookups/maxmind_geoip2_test.rb +++ b/test/unit/lookups/maxmind_geoip2_test.rb @@ -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 diff --git a/test/unit/lookups/maxmind_local_test.rb b/test/unit/lookups/maxmind_local_test.rb index b5bf847c4585d5c35fca3e8e89d50bb5d3af4b5f..87b494814cab6e8b492769cc30d66cfb4d9876f4 100644 --- a/test/unit/lookups/maxmind_local_test.rb +++ b/test/unit/lookups/maxmind_local_test.rb @@ -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 diff --git a/test/unit/lookups/opencagedata_test.rb b/test/unit/lookups/opencagedata_test.rb index 3e838b657bc0c42378419ffd7241afc03687ae2b..496ec14a5220e6d6f3051b7e6e1f25836b978529 100644 --- a/test/unit/lookups/opencagedata_test.rb +++ b/test/unit/lookups/opencagedata_test.rb @@ -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 diff --git a/test/unit/lookups/smarty_streets_test.rb b/test/unit/lookups/smarty_streets_test.rb index 7e999a6c1fe2c9bdf84a8f90b60b859a41257bb7..04e19c43516587b09469b92e2a617e24c6c3717b 100644 --- a/test/unit/lookups/smarty_streets_test.rb +++ b/test/unit/lookups/smarty_streets_test.rb @@ -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