Changed failure message of StringSubject.matches and added test cases#789
Changed failure message of StringSubject.matches and added test cases#789alexw0610 wants to merge 2 commits into
Conversation
Added an additional message to hint at the use of isEqualTo in case of a failed test where most likley a exact equality assertion was needed instead of a regex. Added two test cases to StringSubjectTest to test for the correct failure messages.
|
Does it make sense to apply those same changes to the StringSubject.doesNotMatch method? |
|
Thanks. RE: One comment: It seems like users would be unlikely to run into this problem the
Thoughts? |
Changed the error message a user receives if a matches() test fails with the Pattern overload where the literal representation of the Pattern matches the test string.
|
Yeah good catch. If someone uses the Pattern overload they very likely know they are checking with a regex. I think option 2 makes the most sense here. In any case that will give the user a hint since can be quite confusing at first. |
Added an additional message to hint at the use of isEqualTo in case of a failed test
where most likley a exact equality assertion was needed instead of a regex.
Added two test cases to StringSubjectTest to test for the correct failure messages.
This PR is in reference to #783 (comment)