When doing multiple BeforeEach and at the end of the Describe section, subsequent BeforeEach is not recognized.
lwoydziak opened this issue · 2 comments
lwoydziak commented
Describe("multiple BeforeEach", ()->{
AtomicReference<String> capture = new AtomicReference<>("");
It("then sets 1st capture", () -> {
Assert.assertSame("1st", capture.get());
});
Describe("second BeforeEach", ()->{
It("then sets 2nd capture", () -> {
Assert.assertSame("2nd", capture.get());
});
BeforeEach(() -> {
capture.set("2nd");
});
});
BeforeEach(() -> {
capture.set("1st");
});
});
The above test recreates the error condition.
paulcwarren commented
Thanks @lwoydziak , I'll take a look into these as soon as I can
lwoydziak commented
Incidentally, a work around it to put them at the beginning of the Describe section.