Borachio is now ScalaMock.
I’ve recently been working in my spare time on a native Scala mocking framework.
I now have something which, although far from “done”, is close enough that I think it should be useful. So I’d like to announce and solicit feedback on Borachio – a native Scala mocking framework:
Homepage: http://borachio.com/
GitHub: https://github.com/paulbutcher/borachio
Documentation: http://borachio.com/api/com/borachio/package.html
A couple of examples:
def testTurtle { val t = mock[Turtle] t expects 'penDown t expects 'turn withArgs (90.0) t expects 'forward withArgs (10.0) t expects 'getPosition returning (0.0, 10.0) drawLine(t) }
def testFoldLeft() { val f = mockFunction[String, Int, String] f expects ("initial", 0) returning "intermediate one" f expects ("intermediate one", 1) returning "intermediate two" f expects ("intermediate two", 2) returning "intermediate three" f expects ("intermediate three", 3) returning "final" expect("final") { Seq(0, 1, 2, 3).foldLeft("initial")(f) } }

1 Responses to “Announcing Borachio: Native Scala mocking”
Leave a Reply