我需要使用scalamock嘲笑以下方法,但我没有设法这样做。它在同一时间具有咖喱,具有隐式和重复参数。Scalamock库支持嘲笑这种组合吗?
def apply(key: String, args: Any*)(implicit lang: Lang): String
怎么样?
"complicated paramter lists" should "be mockable" in {
trait Foo {
def apply(key: String, args: Any*)(implicit lang: String): String
}
val m = mock[Foo]
(m.apply(_: String, _: Seq[Any])(_: String)) expects(*, *, *) returning "Foo" once()
implicit val s = "foo"
m.apply("bar", 5, true, 42.0) should be ("Foo")
}