Skip to content

Instantly share code, notes, and snippets.

@delucas
Created September 25, 2012 19:24
Show Gist options
  • Save delucas/3783899 to your computer and use it in GitHub Desktop.
Save delucas/3783899 to your computer and use it in GitHub Desktop.
Ejemplo de Testing sobre Excepciones en Groovy - JUnit3 y JUnit4
class ExceptionTestsJUnit3 extends GroovyTestCase {
void testDebeArrojarArithmeticExcepcion() {
shouldFail(ArithmeticException) {
1 / 0
}
}
}
import org.junit.Test
class ExceptionTestsJUnit4 {
@Test(expected=ArithmeticException.class)
public void testDebeArrojarArithmeticExcepcion() {
1 / 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment