public class AbstractSpec implements Spec
Spec.DefaultImpls| Constructor and Description |
|---|
AbstractSpec() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTestCase(java.lang.String name,
kotlin.jvm.functions.Function2<? super io.kotlintest.TestContext,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> test,
TestCaseConfig config,
TestType type) |
<T extends Closeable> |
autoClose(T closeable)
Registers a field for auto closing after all tests have run.
|
void |
closeResources() |
TestCase |
createTestCase(java.lang.String name,
kotlin.jvm.functions.Function2<? super io.kotlintest.TestContext,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> test,
TestCaseConfig config,
TestType type) |
boolean |
getAcceptingTopLevelRegistration() |
TestCaseConfig |
getDefaultTestCaseConfig()
Config applied to each test case if not overridden per test case.
|
boolean |
isInstancePerTest()
Returns true if this spec should use a new instance for
each test case. This is the default behavior in jUnit.
|
void |
setAcceptingTopLevelRegistration(boolean p) |
java.util.List<io.kotlintest.TestCase> |
testCases()
These are the top level
class TestCase instances for this Spec. |
closeResources, description, extensions, focused, hasFocusedTest, isInstancePerTest, isolationMode, listeners, tags, testCaseOrder, testCasesafterDiscovery, afterProject, afterSpec, afterSpec, afterSpecClass, afterSpecCompleted, afterTest, afterTest, beforeProject, beforeSpec, beforeSpec, beforeSpecClass, beforeSpecStarted, beforeTest, beforeTestpublic boolean getAcceptingTopLevelRegistration()
public void setAcceptingTopLevelRegistration(boolean p)
public boolean isInstancePerTest()
Returns true if this spec should use a new instance for each test case. This is the default behavior in jUnit.
If however you want a single instance to be shared for all tests in the same class, like ScalaTest, then this method should return false.
Note: Not all spec types support allowing one instance per test. This is due to implementation trickery required with nested closures and junit test discovery.
public java.util.List<io.kotlintest.TestCase> testCases()
These are the top level class TestCase instances for this Spec.
class TestCasepublic TestCase createTestCase(java.lang.String name, kotlin.jvm.functions.Function2<? super io.kotlintest.TestContext,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> test, TestCaseConfig config, TestType type)
public void addTestCase(java.lang.String name,
kotlin.jvm.functions.Function2<? super io.kotlintest.TestContext,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> test,
TestCaseConfig config,
TestType type)
public <T extends Closeable> T autoClose(T closeable)
Registers a field for auto closing after all tests have run.
public void closeResources()
public TestCaseConfig getDefaultTestCaseConfig()
Config applied to each test case if not overridden per test case.