Skip to content

Commit

Permalink
Fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kantis committed Feb 5, 2023
1 parent 355cbc3 commit 285317c
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions src/test/kotlin/io/kotest/plugin/pitest/Kotest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,40 @@ import io.kotest.matchers.shouldBe

class Kotest : FunSpec() {

init {
init {

test("StringSpecs") {
val resultCollector = findTestsIn(StringSpecs::class.java)
resultCollector.skipped.shouldBeEmpty()
resultCollector.started.shouldHaveSize(2)
resultCollector.ended.shouldHaveSize(2)
resultCollector.failures.shouldHaveSize(1)
}
test("StringSpecs") {
val resultCollector = findTestsIn(StringSpecs::class.java)
resultCollector.skipped.shouldBeEmpty()
resultCollector.started.shouldHaveSize(2)
resultCollector.ended.shouldHaveSize(2)
resultCollector.failures.shouldHaveSize(1)
}

test("FunSpecs") {
val resultCollector = findTestsIn(FunSpecs::class.java)
resultCollector.skipped.shouldBeEmpty()
resultCollector.started.shouldHaveSize(2)
resultCollector.ended.shouldHaveSize(2)
resultCollector.failures.shouldHaveSize(1)
}
test("FunSpecs") {
val resultCollector = findTestsIn(FunSpecs::class.java)
resultCollector.skipped.shouldBeEmpty()
resultCollector.started.shouldHaveSize(2)
resultCollector.ended.shouldHaveSize(2)
resultCollector.failures.shouldHaveSize(1)
}

test("WordSpecs") {
val resultCollector = findTestsIn(WordSpecs::class.java)
resultCollector.skipped.shouldBeEmpty()
resultCollector.started.shouldHaveSize(7)
resultCollector.ended.shouldHaveSize(7)
resultCollector.failures.shouldHaveSize(2)
}
}
test("WordSpecs") {
val resultCollector = findTestsIn(WordSpecs::class.java)
resultCollector.skipped.shouldBeEmpty()
resultCollector.started.shouldHaveSize(7)
resultCollector.ended.shouldHaveSize(7)
resultCollector.failures.shouldHaveSize(2)
}
}

private fun findTestsIn(clazz: Class<*>): TestResultCollector {
val resultCollector = TestResultCollector()
KotestUnitFinder().findTestUnits(clazz)
.stream()
.forEach { testUnit -> testUnit.execute(resultCollector) }
return resultCollector
}
private fun findTestsIn(clazz: Class<*>): TestResultCollector {
val resultCollector = TestResultCollector()
KotestUnitFinder().findTestUnits(clazz, null)
.stream()
.forEach { testUnit -> testUnit.execute(resultCollector) }
return resultCollector
}
}

private class FunSpecs : FunSpec() {
Expand Down

0 comments on commit 285317c

Please sign in to comment.