thoughtbot / shoulda-matchers

Simple one-liner tests for common Rails functionality
https://matchers.shoulda.io
MIT License
3.51k stars 912 forks source link

fix: Adjust negative form of `ValidateNumericalityMatcher` #1603

Closed matsales28 closed 9 months ago

matsales28 commented 9 months ago

This commit adjusts the negative form of the ValidateNumericalityMatcher so that is does not use the does_not_match? method, but uses the negative result of the matches? method. This is easy to understand and requires no special handling for the negative form.

Previously, this matcher on the negative form was always returning true, as there were no does_not_match? method defined, which caused it to use the does_not_match? method from the ValidationMatcher parent class, which always returns true, this commit fixes that.

Closes: #1601