Created
July 13, 2016 04:27
-
-
Save hoangtranwork/8166d7c7d1202d3113ddb835f82f014e to your computer and use it in GitHub Desktop.
with invocation set, before/after hook seems to not run correctly around `each` invocation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kotlintest.playground | |
import io.kotlintest.KTestJUnitRunner | |
import io.kotlintest.specs.StringSpec | |
import org.junit.runner.RunWith | |
/** | |
* Created by hoang on 7/13/16. | |
*/ | |
@RunWith(KTestJUnitRunner::class) | |
class InvocationExample : StringSpec() { | |
override val oneInstancePerTest = true | |
override fun beforeAll() { | |
println("====beforeAll run ${Thread.currentThread().name}") | |
} | |
override fun afterAll() { | |
println("====afterAll run ${Thread.currentThread().name}") | |
} | |
override fun beforeEach() { | |
println("====beforeEach run ${Thread.currentThread().name}") | |
} | |
override fun afterEach() { | |
println("====afterEach run ${Thread.currentThread().name}") | |
} | |
init { | |
println("==init run ${Thread.currentThread().name}") | |
"a test that run multiple times" { | |
println("======test run ${Thread.currentThread().name}") | |
}.config(invocations = 3) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment