1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/spec/support/unit/matchers
Elliot Winkler e708789714 Fix failure message for numericality matcher
Secondary author: Mauro George <maurogot@gmail.com>

Sometimes the failure message did not always provide the reason for
failure. For instance, given this validation:

    validates :ano, numericality: { only_integer: true, greater_than_or_equal_to: 1900 }

this test:

    it { should validate_numericality_of(:ano).is_greater_than_or_equal_to(1900) }

would fail with the following:

    Did not expect errors  when ano is set to 1900.000000000001, got error:

as you can see, the failure message doesn't contain the validation
error.

In the process of making this fix, we changed how the matcher fails so
that it will so when the first submatcher fails, not the last. This
changes what the failure message looks like, but not the basic
functionality of the matcher itself.
2015-06-01 01:38:35 -06:00
..
deprecate.rb Deprecate set_the_flash in favor of set_flash 2014-11-21 14:24:00 -07:00
fail_with_message_including_matcher.rb Improve failure messages for #fail_with_message_including 2015-03-28 18:12:02 -06:00
fail_with_message_matcher.rb Fix failure message for numericality matcher 2015-06-01 01:38:35 -06:00
print_warning_including.rb Bring set_session in line with set_flash 2014-11-21 14:27:44 -07:00