Native Scala mocking
This page describes ScalaMock 3, which supports Scala 2.10 only. For earlier versions of Scala, see ScalaMock 2
Record-then-Verify (Mockito) Style
Full worked example.
- Fully typesafe
- Full support for Scala features such as:
- Polymorphic (type parameterised) methods
- Operators (methods with symbolic names)
- Overloaded methods
- Type constraints
- ScalaTest and Specs2 integration
Download from Sonatype.
To use ScalaMock in sbt with ScalaTest add the following to your project file:
and with Specs2:
The source is hosted on GitHub.
When Scala supports macro types, this will enable:
- Mocking object creation (constructors)
- Mocking singleton and companion objects (static methods)
- Mocking final classes and classes with final methods or private constructors
YourKit is kindly supporting open source projects with its full-featured Java Profiler.
YourKit, LLC is the creator of innovative and intelligent tools for profiling
Java and .NET applications. Take a look at YourKit's leading software products:
YourKit Java Profiler and
YourKit .NET Profiler.