@RunWith(JSpec.class)
public class JSpecs {{
describe("A spec", () -> {
List<String> items = new ArrayList<>();
before(() -> {
items.add("foo");
items.add("bar");
});
after(() -> {
items.clear();
});
it("runs the before() blocks", () -> {
assertThat(items, contains("foo", "bar"));
});
describe("when nested", () -> {
before(() -> {
items.add("baz");
});
it("runs before and after from inner and outer scopes", () -> {
assertThat(items, contains("foo", "bar", "baz"));
});
});
});
}}
-
Notifications
You must be signed in to change notification settings - Fork 1
meihong-liu/jspec
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A Simple BDD Framework in Java8.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published