- About Scala
- In the Enterprise
- Scala Community
- Language Research
- In the Press
- The Scala Team
- Scala's Prehistory
- Contact Us
- Learning Scala
- Tour of Scala
- Scala API
- Setup & Getting Started
- Programming Guides
- Other Guides
- Code Examples
- Scala Developers
"Power" mocking in Scala
Tue, 2011-07-05, 16:45
Over the last few weeks, I’ve been working on major enhancements for Borachio (my native mocking library for Scala) to add facilities similar to those provided byPowerMock for Java. As well as interfaces and functions, it can now mock:
- Final classes and classes with final methods
- Classes with private constructors
- Singleton (companion) objects
- Object creation (i.e. new)
And, as an extra bonus, mocks are now typesafe :-)
It’s not completely finished yet, but it is close enough that it’s worth soliciting feedback.
There's a writeup on my blog here:
I hope that it's complete enough to be useful. Certainly it’s complete enough that I’d welcome feedback on anything that doesn’t work or could be done better. I'd be particularly interested in feedback from anyone who's familiar with compiler internals or compiler plugins to point out things I could be doing better in the plugin.
Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?