diff --git a/shared/src/test/scala/com/paulbutcher/test/TestTrait.scala b/shared/src/test/scala/com/paulbutcher/test/TestTrait.scala index 31d1620a..d1b84e97 100644 --- a/shared/src/test/scala/com/paulbutcher/test/TestTrait.scala +++ b/shared/src/test/scala/com/paulbutcher/test/TestTrait.scala @@ -38,6 +38,7 @@ trait TestTrait { def curried(x: Int)(y: Double): String def curriedFuncReturn(x: Int): Double => String + def curriedVarargs(x: Int*)(y: String*): Unit def polymorphic[T](x: List[T]): String def polycurried[T1, T2](x: T1)(y: T2): (T1, T2) def polymorphicParam(x: (Int, Double)): String diff --git a/shared/src/test/scala/com/paulbutcher/test/mock/MockTest.scala b/shared/src/test/scala/com/paulbutcher/test/mock/MockTest.scala index 36ca11e2..e25a8e0f 100644 --- a/shared/src/test/scala/com/paulbutcher/test/mock/MockTest.scala +++ b/shared/src/test/scala/com/paulbutcher/test/mock/MockTest.scala @@ -464,6 +464,14 @@ class MockTest extends AnyFreeSpec with MockFactory with Matchers { // m.protectedMethod _ expects() anyNumberOfTimes() } + "mock a trait with curried varargs" in withExpectations { + val foo = mock[TestTrait] + + (foo.curriedVarargs((_: Seq[Int])*)((_: Seq[String])*)).expects(Seq(1, 2), Seq("foo")).returns(()) + + foo.curriedVarargs(1, 2)("foo") + } + "log all calls" in withExpectations { val m = mock[TestTrait]