1. Allow using regular expressions as method names:
def mock = mock()
mock./set.*/(1).returns(2)
play {
assertEquals 2, mock.setSomething(1)
}
It is easy to implement, just change '==' to '==~' in method name
matching.
2. AST transformation @WithGMock(I am not sure it is a proper name):
@WithGMock
class SomeTest extends TestCase { // not extending GMockTestCase
void testSomething() {
def mock = mock()
mock.fun()
play {
mock.fun()
}
}
}
The code above will be transformed to:
class SomeTest extends TestCase {
private $gMockController = new org.gmock.GMockController()
private mock(Object... args) {
$gMockController.mock(args)
}
...
private match(Closure closure) {
org.gmock.GMock.match(closure)
}
...
void testSomething() {
def mock = mock()
mock.fun()
play {
mock.fun()
}
}
}
This can simplify the tests which are not extending GMockTestCase.