Created
January 22, 2013 08:45
-
-
Save spiffxp/4593110 to your computer and use it in GitHub Desktop.
Troubles w/ ScalaTest suite-scoped mocks in ScalaMock 3.x when using proxy mocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example | |
import org.scalatest.FunSuite | |
import org.scalamock.scalatest.MockFactory | |
import org.scalamock.proxy.ProxyMockFactory | |
class SuiteScopedMockTest extends FunSuite with MockFactory with ProxyMockFactory { | |
trait Foo { | |
def foo (i: Int) | |
} | |
val foo = super[ProxyMockFactory].mock[Foo] | |
test("suite-scoped Foo expects 1") { | |
foo.expects('foo)(1) | |
foo.foo(1) | |
} | |
test("the call with 2 should not be unexpected") { | |
foo.expects('foo)(2) | |
foo.foo(2) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment