redding/mr — pull request #26 by jcredding (2013-06-03 16:31:41+00:00)
Title: Friendlier `assert_field_saved` (and inverse) test helpers

This makes the `assert_field_saved` and it's inverse friendlier
test helpers. This involved a few changes:

* If a record hasn't been saved, don't error. Instead default
the saved attributes to an empty hash.
* When using the helpers without specifying a specific value,
ensure it was saved with a non-nil value. Otherwise this can
"hide" problems. If you want to make sure a value was unset,
then pass `nil` explicitly.

These tweaks make the test helpers friendlier and behave as would
typically be expected.

In addition to this, this adds tests for the helpers to make sure
bugs don't end up in these helpers.

This is related to #24.

@kellyredding - I wanted to fix the bad backtrace issue, but I don't think there's a clear way to do it. These are not assert macros, just custom assertion methods. I didn't see how to fix the backtrace quickly and don't want to put the time digging into figuring it out just yet.