shubhj / instinct

Automatically exported from code.google.com/p/instinct
0 stars 0 forks source link

Expected exception try-catch should only wrap specs, not before and after #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If a before or after spec method throws an exception, it will get checked 
against the expected 
exception. This should not happen.

The following class will pass, but should fail, as the after spec throws an 
exception, and the 
expected exception from the spec method is never thrown.

class Foo {
    void after() {
        throw new RuntimeException();
    }

    @Specification(expected = RuntimeException.class)
    void spec() {
    }
}

Original issue reported on code.google.com by tomjad...@gmail.com on 4 Dec 2007 at 6:04

GoogleCodeExporter commented 9 years ago
Fixed.

Original comment by tomjad...@gmail.com on 31 Jul 2008 at 1:18