From 821ce0b1f15349421938dec57d1df2834fa97c37 Mon Sep 17 00:00:00 2001 From: Paul Butcher Date: Sun, 8 Feb 2015 00:33:00 +0000 Subject: [PATCH] Issue #93 is fixed in ScalaMock4 --- .../scala/com/paulbutcher/test/mock/MockTest.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core_tests/src/test/scala/com/paulbutcher/test/mock/MockTest.scala b/core_tests/src/test/scala/com/paulbutcher/test/mock/MockTest.scala index 88bd6a63..efdadcdf 100644 --- a/core_tests/src/test/scala/com/paulbutcher/test/mock/MockTest.scala +++ b/core_tests/src/test/scala/com/paulbutcher/test/mock/MockTest.scala @@ -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") } + } } }