fun haveSameMinutes(time: LocalTime): Matcher<LocalTime>
Matcher that compares minutes of LocalTimes
Verifies that two times have exactly the same minutes, ignoring any other fields. For example, 23:59:30:9999 has the same minutes as 12:59:02:3333, and the matcher will have a positive result for this comparison
val firstTime = LocalTime.of(23, 59, 30, 1000)
val secondTime = LocalTime.of(12, 59, 2, 3333)
firstTime should haveSameMinutes(secondTime) // Assertion passes
val firstTime = LocalTime.of(23, 59, 30, 1000)
val secondTime = LocalTime.of(23, 20, 30, 1000)
firstTime shouldNot haveSameMinutes(secondTime) // Assertion passes
See Also