Created
March 6, 2014 16:01
-
-
Save blackdrag/9392916 to your computer and use it in GitHub Desktop.
meta class test for EMC overwriting potentially existing meta class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def list = [] | |
try { | |
list.noSuchMethod() | |
assert false | |
} catch (MissingMethodException mme) { | |
assert true | |
} | |
ExpandoMetaClass.enableGlobally() | |
List.metaClass.methodMissing = { String name, args -> | |
true | |
} | |
assert list.noSuchMethod() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment