blob: ccf8b8a9e6b94960788f21c33af1fd3003f8b3b2 [file] [log] [blame]
package groovy.bugs
class Groovy3834Bug extends GroovyTestCase {
void testDuplicateCallsToMissingMethod() {
def instance = new AClassWithMethodMissingMethod()
shouldFail MissingMethodException, { instance.someMissingMethod() }
assertEquals 1, instance.count
}
}
class AClassWithMethodMissingMethod {
int count = 0
def methodMissing(String name, args) {
count++
throw new MissingMethodException(name, AClassWithMethodMissingMethod, args)
}
}