From d785ae2a8de021905901f83f70ac28ce13ab7b4b Mon Sep 17 00:00:00 2001 From: Taeik Lim Date: Mon, 16 Dec 2024 10:47:24 +0900 Subject: [PATCH] Use KotlinArbitraryBuilder in kotest (#1122) Signed-off-by: Taeik Lim --- .../com/navercorp/fixturemonkey/kotest/ArbExtension.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fixture-monkey-kotest/src/main/kotlin/com/navercorp/fixturemonkey/kotest/ArbExtension.kt b/fixture-monkey-kotest/src/main/kotlin/com/navercorp/fixturemonkey/kotest/ArbExtension.kt index d19bb8005..ec36ba439 100644 --- a/fixture-monkey-kotest/src/main/kotlin/com/navercorp/fixturemonkey/kotest/ArbExtension.kt +++ b/fixture-monkey-kotest/src/main/kotlin/com/navercorp/fixturemonkey/kotest/ArbExtension.kt @@ -25,7 +25,9 @@ import com.navercorp.fixturemonkey.FixtureMonkey import com.navercorp.fixturemonkey.api.property.PropertySelector import com.navercorp.fixturemonkey.api.type.TypeReference import com.navercorp.fixturemonkey.api.type.Types +import com.navercorp.fixturemonkey.kotlin.KotlinTypeDefaultArbitraryBuilder import com.navercorp.fixturemonkey.kotlin.giveMeBuilder +import com.navercorp.fixturemonkey.kotlin.giveMeKotlinBuilder import com.navercorp.fixturemonkey.kotlin.giveMeOne import com.navercorp.fixturemonkey.kotlin.propertyExpressionGenerator import io.kotest.property.Arb @@ -67,9 +69,9 @@ inline fun FixtureMonkey.giveMeArb(): Arb { } } -inline fun FixtureMonkey.giveMeArb(crossinline applyBuilder: ArbitraryBuilder.() -> ArbitraryBuilder): Arb = +inline fun FixtureMonkey.giveMeArb(crossinline applyBuilder: KotlinTypeDefaultArbitraryBuilder.() -> ArbitraryBuilder): Arb = arbitrary { - applyBuilder.invoke(this@giveMeArb.giveMeBuilder()).sample() + applyBuilder.invoke(this@giveMeArb.giveMeKotlinBuilder()).sample() } fun ArbitraryBuilder.setArb(expression: String, arb: Arb): ArbitraryBuilder = this.set(