Skip to content

Commit

Permalink
Merge pull request #559 from goshacodes/issue131
Browse files Browse the repository at this point in the history
added test for issue 131
  • Loading branch information
goshacodes authored Jan 3, 2025
2 parents b881dac + 7e5216c commit a2fcaee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions shared/src/test/scala/com/paulbutcher/test/TestTrait.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit a2fcaee

Please sign in to comment.