There might be a way to mock what you are trying to achieve here.
Create a special mock version of your object like:
class MockDomainClass {
def mock
MockDomainClass(mock){
this.mock = mock
}
def withTransaction(Closure closure){
closure.setDelegate(mock)
closure.call()
}
def methodMissing(String name, args) {
mock."$name"(args.toList())
}
}
I've used this technique in the past. Hopefully it will solve your
problem.
And yes we've plan to support mock for closure but nothing has really
been done so far ;)
On Sep 3, 2:04 am, Johnny Jian <
johnnyjia...@gmail.com> wrote:
> We plan to support mocking closures in version 0.9 (please refer tohttp://
code.google.com/p/gmock/issues/detail?id=54), and it is not finished
> yet.
>
> On Thu, Sep 3, 2009 at 2:32 AM, Jozef Dransfield
> <
jozefdransfi...@gmail.com>wrote: