Skip to content

Commit

Permalink
rename mode argument
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddenton committed Aug 23, 2023
1 parent a8b7479 commit f6762e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mock4k/src/main/kotlin/dev/forkhandles/mock4k/mock.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import java.lang.reflect.Proxy
import java.lang.reflect.UndeclaredThrowableException
import kotlin.reflect.KClass

inline fun <reified T> mock(relaxed: MockMode = Strict): T = Proxy.newProxyInstance(
inline fun <reified T> mock(mode: MockMode = Strict): T = Proxy.newProxyInstance(
T::class.java.classLoader,
arrayOf(T::class.java)
) { _, method, args ->
when (relaxed) {
when (mode) {
Strict -> throw UnstubbedCall(T::class, method.name, args.toList())
Relaxed -> null
}
Expand Down

0 comments on commit f6762e8

Please sign in to comment.