Closed lnestor closed 5 years ago
I went ahead and checked that a diff is produced for both. I can separate them into their own it
instances if you want. Also, CI failed because it timed out, is there a way to retry the job?
@lnestor I suggest you to:
git commit --amend
git push --force-with-lease lnestor diff-generation-nil-check
to re-run the build.
Previous Behavior
The following lines create different output:
The first generates a diff, whereas the second does not. This is because the actual and expected values are checked for presence with
if actual && expected
when creating the diff. In the first example, the actual is true, so it passes the check. In the second, the actual is false and the diff returned is an empty string.New Behavior
These should be consistent with each other. The two options would be to make them both create a diff or modify the matcher so neither do. However, since all other
match(something)
matchers produce a diff output, it makes sense to do the same here.If it is necessary for that check to also check for truthiness, then another solution could be found. But, I cannot find a situation where false would be passed in where we wouldn't want to create a diff.