-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve
errors
method check in be_valid matcher (#2096)
If the `.be_valid?` matcher fails, it checks for the presence of a `.errors` method and uses it, if present, in the failure message. This works great, unless the subject happens to include an `errors` method that takes an argument, in which case we get an error (because we call errors with 0 arguments), this checks the arity of that method before we call it.
- Loading branch information
Showing
2 changed files
with
17 additions
and
1 deletion.
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