Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6.3
-
None
-
None
Description
http://permalink.gmane.org/gmane.comp.lang.groovy.user/42103
When using a closure to mock an interface, it should not be called when invoking methods, that are not declared in the interface:
==================================
Closure failing = {
throw new RuntimeException("for test")
}
interface MyType {
def abc()
def xyz()
}
MyType instance = failing as MyType
// ****** all 3 calls below result in the closure to be invoked *****
instance.abc()
instance.xyz()
instance.toString()
==================================