Write better tests with


Simple yet powerful native Scala mocking framework.

test("drawLine interaction with Turtle") {
  // Create mock Turtle object
  val mockedTurtle = mock[Turtle]
  // Set expectations
  (mockedTurtle.setPosition _).expects(10.0, 10.0)
  (mockedTurtle.forward _).expects(5.0)
  (mockedTurtle.getPosition _).expects().returning(15.0, 10.0)
  // Exercise System Under Test
  drawLine(mockedTurtle, (10.0, 10.0), (15.0, 10.0))


Simple yet powerful

ScalaMock has very clean and concise syntax, reasonable defaults, powerful features and is fully type-safe.

Full Scala support

Full support for Scala features such as: Polymorphic methods, Operators, Overloaded methods, Type constraints, and more.

ScalaTest and Specs2 integration

ScalaMock can be easily used in ScalaTest and Specs2 testing frameworks.


Also find us on Scaladex