Open jacobg opened 8 years ago
Hi, I agree, it should definately not throw a NullPointerException but return false. I'll apply a fix which will be included in the next release
Thanks!
Hi, Just to keep you up to date. Many of the calls can suffer NullPointerException if the expectation is null so i'm setting up tests and applying the fixes for all. It may take a little while to fix them all up. Will reply on this post once they're resolved. Thanks, Stewart
Current behavior when calling sameInstant with a null date is NullPointerException:
It'd be nice if the matcher constructor did not have that exception, and would just return false on the matchesSafely call. That would allow a composite match like this:
assertThat(date, either(sameInstant(otherDate)).or(allOf(nullValue(), is(otherDate))));