Skip to content

Commit fb82f5e

Browse files
committed
Compare millis. Closes cucumber#440
1 parent 673121f commit fb82f5e

File tree

1 file changed

+5
-1
lines changed
  • examples/java-helloworld/src/test/java/cucumber/examples/java/helloworld

1 file changed

+5
-1
lines changed

examples/java-helloworld/src/test/java/cucumber/examples/java/helloworld/TimeStepdefs.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ public void I_did_laundry_time_ago(@Transform(ChronicConverter.class) Calendar l
2828

2929
@Then("^my laundry day must have been \"([^\"]*)\"$")
3030
public void my_laundry_day_must_have_been(Calendar day) throws Throwable {
31-
assertEquals(day, laundryDate);
31+
// Ideally we'd compare the Calendar instances here, but due to Chronic's
32+
// use of default Locale and Cucumber's inability to set its Locale to e.g.
33+
// en-GB, this would cause failures on machines that don't have Locale.US or Locale.ENGLISH
34+
// as the default Locale. For more details see https://github.com/cucumber/cucumber-jvm/issues/440
35+
assertEquals(day.getTimeInMillis(), laundryDate.getTimeInMillis());
3236
}
3337

3438
public static class ChronicConverter extends Transformer<Calendar> {

0 commit comments

Comments
 (0)