-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
190 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
23 changes: 23 additions & 0 deletions
23
...s-junit5/src/test/kotlin/com/sksamuel/kotlintest/junit5/StringSpecExceptionInAfterTest.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.sksamuel.kotlintest.junit5 | ||
|
||
import io.kotlintest.TestCase | ||
import io.kotlintest.TestResult | ||
import io.kotlintest.shouldBe | ||
import io.kotlintest.specs.StringSpec | ||
|
||
class StringSpecExceptionInAfterTest : StringSpec() { | ||
|
||
init { | ||
"a failing test" { | ||
1 shouldBe 2 | ||
} | ||
|
||
"a passing test" { | ||
1 shouldBe 1 | ||
} | ||
} | ||
|
||
override fun afterTest(testCase: TestCase, result: TestResult) { | ||
throw RuntimeException("craack!!") | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...-junit5/src/test/kotlin/com/sksamuel/kotlintest/junit5/StringSpecExceptionInBeforeTest.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.sksamuel.kotlintest.junit5 | ||
|
||
import io.kotlintest.TestCase | ||
import io.kotlintest.shouldBe | ||
import io.kotlintest.specs.StringSpec | ||
|
||
class StringSpecExceptionInBeforeTest : StringSpec() { | ||
|
||
init { | ||
"a failing test" { | ||
1 shouldBe 2 | ||
} | ||
|
||
"a passing test" { | ||
1 shouldBe 1 | ||
} | ||
} | ||
|
||
override fun beforeTest(testCase: TestCase) { | ||
throw RuntimeException("oooff!!") | ||
} | ||
} |