Skip to content

Instantly share code, notes, and snippets.

@blackdrag
Created March 6, 2014 16:01
Show Gist options
  • Save blackdrag/9392916 to your computer and use it in GitHub Desktop.
Save blackdrag/9392916 to your computer and use it in GitHub Desktop.
meta class test for EMC overwriting potentially existing meta class
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