-
-
Notifications
You must be signed in to change notification settings - Fork 910
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix failure message for numericality matcher
Secondary author: Mauro George <[email protected]> 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.
- Loading branch information
Showing
5 changed files
with
231 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,9 @@ def rails_4_x? | |
def rails_gte_4_1? | ||
rails_version >= 4.1 | ||
end | ||
|
||
def rails_gte_4_2? | ||
rails_version >= 4.2 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.