Skip to content

Instantly share code, notes, and snippets.

@haydenmuhl
Created July 13, 2011 06:04
Show Gist options
  • Save haydenmuhl/1079805 to your computer and use it in GitHub Desktop.
Save haydenmuhl/1079805 to your computer and use it in GitHub Desktop.
How to mock objects instantiated inside another class?
class CommandLine {
def ls() {
def cmd = "ls".execute()
if(cmd.waitFor() != 0) {
throw new Execution()
}
return cmd.text
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment