everypolitician / scraper_test

Data-driven scraper tests for Scraped
0 stars 0 forks source link

Expected and actual are backwards in test failure #5

Closed chrismytton closed 7 years ago

chrismytton commented 7 years ago

Problem

When the expected return value from #to_h (which is defined in the test/data/*.yml files) doesn't match the actual return value the error message gets things backwards.

Here I've not got anything in the test file, but the output (wrongly) suggests there was nothing returned from #to_h.

Proposed solution

Reverse the order of arguments to assert_equals when checking expected vs actual #to_h values.