-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aroundAll runs even when all specs are ignored #73
Comments
The suite should be able to tell if its children are ignored. The question is, I guess, whether it needs to be testing for ignored of direct descendants, or the whole tree. Just add // suite
boolean areChildrenIgnored() {
return children.stream().filter(child -> !child.isIgnored()).findFirst().isPresent();
} |
This will be fixed by #56 which would otherwise be doing big class-rule things with totally ignored suites. |
@ashleyfrieze we should check if this bug still applies, or whether it was fixed by #56 . |
I think this may have been fixed by #56 describe("a suite with only ignored specs", () -> {
it("should not run aroundAll", () -> {
ArrayList<String> steps = new ArrayList<>();
SpectrumHelper.run(() -> {
aroundAll(block -> {
steps.add("aroundAll");
block.run();
});
xit("foo", () -> {
});
});
assertThat(steps, is(empty()));
});
}); That passes - it's a test within a test. The I wonder if I stole this test from somewhere and made it pass while making the hooks work for JUnit mixins. I can't remember. |
Resolved by #56. |
This is a low-priority one, but should probably get addressed at some point. At the moment, there isn't a simple implementation fix, because
Suite
objects don't know which of their children are ignored or not. I think the underlying implementation will evolve to be based more around tags anyway; fixing this issue will be simpler after that.For reference, this is the failing test:
The text was updated successfully, but these errors were encountered: