Skip to content

Commit 527c383

Browse files
fix tests
1 parent d022484 commit 527c383

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

examples/cycle-module/src/test/kotlin/org.koin.example/TestModule.kt renamed to examples/cycle-module/src/test/kotlin/org.koin.example/CycleTestModule.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import org.koin.example.cycle.CycleModule
77
import org.koin.example.cycle.LazyCycleModule
88
import org.koin.ksp.generated.*
99

10-
class TestModule {
10+
class CycleTestModule {
1111

1212
@Test
13-
fun testApp() {
13+
fun cycleTestApp() {
1414
koinApplication {
1515
printLogger(Level.DEBUG)
1616
// else let's use our modules

examples/other-ksp/src/main/kotlin/org/koin/example/animal/Animal.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import kotlin.random.Random
55

66
public interface Animal
77

8-
@Single(binds = [])
8+
@Single
99
public class Dog : Animal
1010

11-
@Single(binds = [])
11+
@Single
1212
public class Cat : Animal
1313

1414
public class Bunny(public val color: String) : Animal

examples/other-ksp/src/test/kotlin/org.koin.example/TestModule.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import org.koin.example.supertype.D
3737
import org.koin.example.supertype.SuperTypesModule
3838
import org.koin.ksp.generated.defaultModule
3939
import org.koin.ksp.generated.module
40+
import kotlin.random.Random
4041
import kotlin.test.assertEquals
4142
import kotlin.test.assertFailsWith
4243
import kotlin.test.assertNotNull
@@ -131,7 +132,8 @@ class TestModule {
131132

132133

133134
private fun randomGetAnimal(koin: Koin): Animal {
134-
val a = koin.get<Animal>()
135+
val animals = koin.getAll<Animal>()
136+
val a = animals[Random.nextInt(animals.size)]
135137
println("animal: $a")
136138
return a
137139
}

0 commit comments

Comments
 (0)