import static specsy.core.Specsy.*; import static specsy.junit.SpecsyJunitRunner.*; describe("MyClass", () -> { it("should perform some action", () -> { }); }); @RunWith(SpecsyJunitRunner.class) public class MyLibraryTest { } public class MyLibrary { public int add(int a, int b) { return a + b; } } import static specsy.core.Specsy.*; import static specsy.junit.SpecsyJunitRunner.*; import org.junit.Assert; @RunWith(SpecsyJunitRunner.class) public class MyLibraryTest { private MyLibrary myLibrary; before(() -> { myLibrary = new MyLibrary(); }); describe("MyLibrary", () -> { it("should add two numbers", () -> { int result = myLibrary.add(2, 3); Assert.assertEquals(5, result); }); }); } <dependency> <groupId>com.specsy</groupId> <artifactId>specsy-core</artifactId> <version>1.0.0</version> <scope>test</scope> </dependency>


上一篇:
下一篇:
切换中文