Open
Description
What happened?
People write:
try {
Main.processArgs("-offset", "10", "-length", "20", "-length", "50", "Foo.java");
fail("fail");
} catch (UsageException e) {
// expected
}
What did you want to happen?
assertThatThrownBy(() -> Main.processArgs("-offset", "10", "-length", "20", "-length", "50", "Foo.java"))
.isInstanceOf(UsageException.class);
Stretch goals:
- preserving the message if it's interesting, e.g.
fail("hardDeleteObjects should have thrown an exception");
- supporting other types of fail e.g. raw junit fail e.g.
org.junit.Assert#fail
Metadata
Metadata
Assignees
Labels
No labels