Skip to content

Commit

Permalink
Fix the assertion description for isAfter
Browse files Browse the repository at this point in the history
  • Loading branch information
lnhrdt authored and robfletcher committed Mar 23, 2022
1 parent 29df71b commit 9395b82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ infix fun <T : TemporalAccessor> Assertion.Builder<T>.isBefore(expected: Tempora
* temporal type.
*/
infix fun <T : TemporalAccessor> Assertion.Builder<T>.isAfter(expected: TemporalAccessor): Assertion.Builder<T> =
assertThat("is before %s", expected) {
assertThat("is after %s", expected) {
when (it) {
is Instant -> it.isAfter(Instant.from(expected))
is ChronoLocalDate -> it.isAfter(LocalDate.from(expected))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ internal class TemporalAssertions : JUnit5Minutests {
local to local.minusDays(1),
Pair(localOffset, localOffset.minusNanos(1))
).forEach { (subject, expected) ->
test("passes asserting $subject (${subject.javaClass.simpleName}) is before $expected (${expected.javaClass.simpleName})") {
test("passes asserting $subject (${subject.javaClass.simpleName}) is after $expected (${expected.javaClass.simpleName})") {
expectThat(subject).isAfter(expected)
}
}
Expand Down Expand Up @@ -215,7 +215,7 @@ internal class TemporalAssertions : JUnit5Minutests {
local to local.plusDays(1),
Pair(localOffset, localOffset.plusNanos(1))
).forEach { (subject, expected) ->
test("fails asserting $subject (${subject.javaClass.simpleName}) is before $expected (${expected.javaClass.simpleName})") {
test("fails asserting $subject (${subject.javaClass.simpleName}) is after $expected (${expected.javaClass.simpleName})") {
assertThrows<AssertionFailedError> {
expectThat(subject).isAfter(expected)
}
Expand Down

0 comments on commit 9395b82

Please sign in to comment.