I have to unit test a method of a groovy class which uses sleep() to delay processing in a loop.
Obviously I don't want my test suite to sleep really, so I tried to mock the sleep() call in my class:
MyClass.metaClass.sleep = { return }
I tried a few variations of this with no success.
Can someone tell me the correct way to mock this language method?