ScalaMock 3.0-M4 (scaladoc) for Scala 2.10.0-RC1 is now released. It supports:
- Mock functions, traits and classes
- Both expectation-first and record-then-verify (Mockito-style) mocking
- ScalaTest and Specs2
To use with
sbt and ScalaTest:
libraryDependencies += "org.scalamock" % "scalamock-scalatest-support_2.10.0-RC1" % "3.0-M4"
or for Specs2:
libraryDependencies += "org.scalamock" % "scalamock-specs2-support_2.10.0-RC1" % "3.0-M4"
For background information, see ScalaMock 3.0 Preview Release.
Known limitations (these should all be fixed when Scala adds support for mock types):
- No support for mocking object creation (constructors)
- No support for mocking singleton/companion objects
- No support for mocking final classes or classes with private constructors
- No support for mocking concrete
- Limited support for overloaded methods
- No support for mocking Java methods with repeated parameters