``` class Foo : FunSpec() { data class Data(v...
# mockk
l
Copy code
class Foo : FunSpec() {

    data class Data(val value: String)
    
    class Dooter {
        fun doot() {}
    }
    class Booer {
        fun boo(data: Data): Dooter {
            return Dooter()
        }
    }
    
    class Fooer {
        fun foo(data: Data): Booer {
            return Booer()
        }
    }
    
    class Target(
        val fooer: Fooer
    ) {
        fun doThings(data: Data) {
            fooer.foo(data).boo(data).doot()
        }
    }
    
    init {
        test("Test") {
            val fooer = mockk<Fooer>(relaxed = true)
            val target = Target(fooer)
            val data = Data("Data")
            
            target.doThings(data)
            
            verify { fooer.foo(data).boo(data).doot() }
        }
    }
}