Hello,
If a change assert fails we get a oneliner failure message like
expected `object.data` to have changed to { "key" => "value" }, but is now
{ "something" => "else" }
With a bulkier object (array of hashes, a large hash, it's common) the
dividing part ", but is now" is hard to see.
Let's improve the readability of failures like this!
There are a number of ways to go about this, but one I've come up with is a
three-line formatting - first describes the nature of the change failure
(did not change/ changed to wrong value etc.), second shows expectation,
and third shows the gotten value, aligned to the second row for easier
diff, like so:
expected `object.data` to have changed, but the new value did not match
expectation:
expected: { "key" => "value" }
was: { "something" => "else" }
Is this something worth opening a PR for? Which github project should I
look at?
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/rspec/092f87d5-3efe-42f4-8cc0-d84dec8e7298n%40googlegroups.com.