Skip to content

Instantly share code, notes, and snippets.

@moznion
Created November 23, 2012 06:39
Show Gist options
  • Save moznion/4134261 to your computer and use it in GitHub Desktop.
Save moznion/4134261 to your computer and use it in GitHub Desktop.
Demonstration of powerfulness of shouldFail(Closure code)
import groovy.util.GroovyTestCase
public class Test extends GroovyTestCase {
public void test() {
shouldFail {assert false}
shouldFail {throw new NullPointerException()}
shouldFail {throw new IllegalAccessError()}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment