Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Unit Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read
Expand All @@ -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
Expand Down
23 changes: 11 additions & 12 deletions test/ipinfo_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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'
}
Expand Down Expand Up @@ -63,7 +63,6 @@ def assert_ip6(resp)
assert_equal(
resp.domains,
{
"page": 0,
"total": 0,
"domains": []
}
Expand All @@ -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')
Expand All @@ -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(
Expand Down