Skip to content

Commit

Permalink
Issue #93 is fixed in ScalaMock4
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbutcher committed Feb 8, 2015
1 parent 76f5c5b commit 821ce0b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core_tests/src/test/scala/com/paulbutcher/test/mock/MockTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -425,5 +425,17 @@ class MockTest extends FreeSpec with MockFactory with ShouldMatchers {
}
val m = mock[P]
}

// Test for issue #93
"mock an overloaded method with a generic parameter available to the trait" in withExpectations {
trait OverloadedMultiParams[A] {
def meth(i: Int, a: A): Int
def meth(): Int
}

val mockTrait = mock[OverloadedMultiParams[String]]
mockTrait.expects.meth(1, "Hello").returns(1)
assertResult(1) { mockTrait.meth(1, "Hello") }
}
}
}

0 comments on commit 821ce0b

Please sign in to comment.