sreedharkesarla / spock

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

[junit4] test should be skipped on org.junit.internal.AssumptionViolatedException #223

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem? If possible, provide source code and
stack trace.

def test() {
    setup:
        Assume.assumeTrue(false);
}
Expected: ignored test
Seen: test failure

What version of Spock and Groovy are you using?
spock-core-0.5-groovy-1.7
groovy1.7.8

Please provide any additional information below. You can also assign
labels.

Original issue reported on code.google.com by scf...@googlemail.com on 19 Jan 2012 at 1:55

GoogleCodeExporter commented 8 years ago

Original comment by pnied...@gmail.com on 19 Jan 2012 at 2:24

GoogleCodeExporter commented 8 years ago
You could write your own JUnit rule or Spock extension for that. 

Original comment by pnied...@gmail.com on 19 Jan 2012 at 2:26

GoogleCodeExporter commented 8 years ago
That is the problem - the only way to cancel test from JUnit rule is to throw 
that exception.

Where can i find some info on Spock extensions?

Original comment by scf...@googlemail.com on 19 Jan 2012 at 2:31

GoogleCodeExporter commented 8 years ago
Best way to learn is from the source code. Have a look at the extensions in 
org.spockframework.runtime.extension.builtin. Note that the extension SPI isn't 
stable, i.e. there will be breaking changes.

Original comment by pnied...@gmail.com on 19 Jan 2012 at 2:37

GoogleCodeExporter commented 8 years ago
I agree that we should handle AssumptionViolatedException for the sake of 
better JUnit compatibility.

Original comment by pnied...@gmail.com on 19 Jan 2012 at 6:08

GoogleCodeExporter commented 8 years ago

Original comment by pnied...@gmail.com on 17 Feb 2012 at 3:06

GoogleCodeExporter commented 8 years ago

Original comment by pnied...@gmail.com on 24 Feb 2012 at 7:33