Allow excluding Kotlin source sets from transformation
This commit is contained in:
@@ -66,4 +66,10 @@ configure<com.bnorm.power.PowerAssertGradleExtension> {
|
||||
"com.bnorm.power.assert",
|
||||
"com.bnorm.power.dbg"
|
||||
)
|
||||
excludedSourceSets = listOf(
|
||||
"commonMain",
|
||||
"jvmMain",
|
||||
"jsMain",
|
||||
"nativeMain"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -20,6 +20,11 @@ data class Person(
|
||||
val firstName: String,
|
||||
val lastName: String,
|
||||
) {
|
||||
init {
|
||||
require(firstName.isNotBlank())
|
||||
require(lastName.isNotBlank())
|
||||
}
|
||||
|
||||
companion object {
|
||||
val UNKNOWN = listOf(Person("John", "Doe"), Person("Jane", "Doe"))
|
||||
override fun toString() = "Person.Companion"
|
||||
|
||||
@@ -63,6 +63,15 @@ class PowerAssertTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun excludedRequire() {
|
||||
val error = assertFailsWith<IllegalArgumentException> { Person("", "") }
|
||||
assertEquals(
|
||||
actual = error.message,
|
||||
expected = "Failed requirement."
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun softAssert() {
|
||||
val unknown: List<Person>? = Person.UNKNOWN
|
||||
|
||||
Reference in New Issue
Block a user