Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test geolonia: reduce checking #202

Merged
merged 1 commit into from
Aug 31, 2024
Merged
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
58 changes: 17 additions & 41 deletions test/test-geolonia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,23 @@ def setup
end

test('#each') do
records = @dataset.each.to_a
assert_equal([
277656,
{
:prefecture_code => "01",
:prefecture_name => "北海道",
:prefecture_kana => "ホッカイドウ",
:prefecture_romaji => "HOKKAIDO",
:municipality_code => "01101",
:municipality_name => "札幌市中央区",
:municipality_kana => "サッポロシチュウオウク",
:municipality_romaji => "SAPPORO SHI CHUO KU",
:street_name => "旭ケ丘一丁目",
:street_kana => "アサヒガオカ 1",
:street_romaji => "ASAHIGAOKA 1",
:alias => nil,
:latitude => "43.04223",
:longitude => "141.319722"
},
{
:prefecture_code => "47",
:prefecture_name => "沖縄県",
:prefecture_kana => "オキナワケン",
:prefecture_romaji => "OKINAWA KEN",
:municipality_code => "47382",
:municipality_name => "八重山郡与那国町",
:municipality_kana => "ヤエヤマグンヨナグニチョウ",
:municipality_romaji => "YAEYAMA GUN YONAGUNI CHO",
:street_name => "字与那国",
:street_kana => nil,
:street_romaji => nil,
:alias => nil,
:latitude => "24.455925",
:longitude => "122.987678",
},
],
[
records.size,
records[0].to_h,
records[-1].to_h,
])
assert_equal({
:prefecture_code => "01",
:prefecture_name => "北海道",
:prefecture_kana => "ホッカイドウ",
:prefecture_romaji => "HOKKAIDO",
:municipality_code => "01101",
:municipality_name => "札幌市中央区",
:municipality_kana => "サッポロシチュウオウク",
:municipality_romaji => "SAPPORO SHI CHUO KU",
:street_name => "旭ケ丘一丁目",
:street_kana => "アサヒガオカ 1",
:street_romaji => "ASAHIGAOKA 1",
:alias => nil,
:latitude => "43.04223",
:longitude => "141.319722",
},
@dataset.each.next.to_h)
end

sub_test_case("#metadata") do
Expand Down
Loading