From f4daff2314562eecd027dc0472953b56fdb3851f Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Tue, 22 Jul 2025 20:13:06 -0600 Subject: [PATCH 1/2] Run "Unit Tests" Github Actions on PR and pushes for `master` branch --- .github/workflows/unittest.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unittest.yaml b/.github/workflows/unittest.yaml index 4841553..adb8742 100644 --- a/.github/workflows/unittest.yaml +++ b/.github/workflows/unittest.yaml @@ -1,7 +1,12 @@ name: Unit Tests on: + push: + branches: + - master pull_request: + branches: + - master permissions: contents: read @@ -12,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.6'] + ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4'] steps: - name: Checkout From a6c2f5ba563d526a7e01d55bb57129e72881cdb4 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Tue, 22 Jul 2025 20:24:05 -0600 Subject: [PATCH 2/2] Update tests --- test/ipinfo_test.rb | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/ipinfo_test.rb b/test/ipinfo_test.rb index cdf3e04..e65c706 100644 --- a/test/ipinfo_test.rb +++ b/test/ipinfo_test.rb @@ -9,15 +9,15 @@ class IPinfoTest < Minitest::Test def assert_ip6(resp) assert_equal(resp.ip, TEST_IPV6) assert_equal(resp.ip_address, IPAddr.new(TEST_IPV6)) - assert_equal(resp.city, 'Hiroshima') - assert_equal(resp.region, 'Hiroshima') + assert_equal(resp.city, 'Osaka') + assert_equal(resp.region, 'Osaka') assert_equal(resp.country, 'JP') assert_equal(resp.country_name, 'Japan') assert_equal(resp.is_eu, false) - assert_equal(resp.loc, '34.4000,132.4500') - assert_equal(resp.latitude, '34.4000') - assert_equal(resp.longitude, '132.4500') - assert_equal(resp.postal, '730-0011') + assert_equal(resp.loc, '34.6938,135.5011') + assert_equal(resp.latitude, '34.6938') + assert_equal(resp.longitude, '135.5011') + assert_equal(resp.postal, '543-0062') assert_equal(resp.timezone, 'Asia/Tokyo') assert_equal(resp.country_flag_url, 'https://cdn.ipinfo.io/static/images/countries-flags/JP.svg') assert_equal( @@ -33,7 +33,7 @@ def assert_ip6(resp) assert_equal( resp.company, { - "name": 'Internet Initiative Japan Inc.', + "name": 'IIJ Internet', "domain": 'iij.ad.jp', "type": 'isp' } @@ -63,7 +63,6 @@ def assert_ip6(resp) assert_equal( resp.domains, { - "page": 0, "total": 0, "domains": [] } @@ -74,7 +73,7 @@ def assert_ip4(resp) assert_equal(resp.ip, TEST_IPV4) assert_equal(resp.ip_address, IPAddr.new(TEST_IPV4)) assert_equal(resp.hostname, 'dns.google') - assert_equal(resp.anycast, true) + assert_equal(resp.is_anycast, true) assert_equal(resp.city, 'Mountain View') assert_equal(resp.region, 'California') assert_equal(resp.country, 'US') @@ -87,9 +86,9 @@ def assert_ip4(resp) assert_equal(resp.country_currency['symbol'], '$') assert_equal(resp.continent['code'], 'NA') assert_equal(resp.continent['name'], 'North America') - assert_equal(resp.loc, '37.4056,-122.0775') - assert_equal(resp.latitude, '37.4056') - assert_equal(resp.longitude, '-122.0775') + assert_equal(resp.loc, '38.0088,-122.1175') + assert_equal(resp.latitude, '38.0088') + assert_equal(resp.longitude, '-122.1175') assert_equal(resp.postal, '94043') assert_equal(resp.timezone, 'America/Los_Angeles') assert_equal(