eXparity / hamcrest-date

A Java library which provides a suite hamcrest matchers for matching dates, times, and moments in time
BSD 3-Clause "New" or "Revised" License
70 stars 11 forks source link

Mismatch description in before() #16

Closed nbraun closed 8 years ago

nbraun commented 8 years ago

The following assertion:

@Test
  public void testDateMatchers() throws ParseException {
    Date a = DateFormatUtils.ISO_DATETIME_FORMAT.parse("2016-02-10T09:00:00");
    Date b = DateFormatUtils.ISO_DATETIME_FORMAT.parse("2016-02-10T11:00:00");
    Assert.assertThat(b, DateMatchers.before(a));
 }

results in the following message:

Expected: the date is after Mi, 10 Feb 2016 09:00:00.000
     but: date is Mi, 10 Feb 2016 11:00:00.000

It should probably read is before

Running java version 1.8.0_92 hamcrest-date 2.0.2

stewbis commented 8 years ago

Hi, Thanks for raising the issue. I'm coding up a fix today and adding tests for the assertion messages. Regards, Stewart

stewbis commented 8 years ago

Resolved in version 2.0.3