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 california-housing: reduce checking #222

Merged
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
43 changes: 12 additions & 31 deletions test/test-california-housing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,18 @@ def record(*args)
end

test("#each") do
records = @dataset.each.to_a
assert_equal([
20640,
{
median_house_value: 452600.000000,
median_income: 8.325200,
housing_median_age: 41.000000,
total_rooms: 880.000000,
total_bedrooms: 129.000000,
population: 322.000000,
households: 126.000000,
latitude: 37.880000,
longitude: -122.230000
},
{
median_house_value: 89400.000000,
median_income: 2.388600,
housing_median_age: 16.000000,
total_rooms: 2785.000000,
total_bedrooms: 616.000000,
population: 1387.000000,
households: 530.000000,
latitude: 39.370000,
longitude: -121.240000
},
],
[
records.size,
records[0].to_h,
records[-1].to_h
])
assert_equal({
median_house_value: 452600.000000,
median_income: 8.325200,
housing_median_age: 41.000000,
total_rooms: 880.000000,
total_bedrooms: 129.000000,
population: 322.000000,
households: 126.000000,
latitude: 37.880000,
longitude: -122.230000,
},
@dataset.each.next.to_h)
end

sub_test_case("#metadata") do
Expand Down