Make Spock behave as junit in RuleInterceptor

38 views
Skip to first unread message

rulien

unread,
Jan 26, 2012, 3:13:53 AM1/26/12
to Spock Framework - User
Hey

I have made a project to categorize tests github.com/rulien/categorize-
test. In lack of a better feature in JUnit this relays on throwing
AssumptionViolatedException in a MethodRule to be able to Ignore a
test based on categories to run. This works in Junit because it
ignores those tests if this happen

In spock the BaseSpecRunner does not handle AssumptionViolated in the
same way and therefore those tests fails. I made a fork of Spock and
based change on the spock-0.5-groovy-1.8 tag (since it's this verision
we are using). This can be seen here https://github.com/rulien/spock/tree/makejunitignoreproperly

I don't know exactly how to make a pull request for this since I am
not that familiar with your release cycle. But if you tell me how to
do it properly I can do it. Or if you feel this change is appropriate
you can merge it in yourself ?

Please feel free to give feedback if the code is bad or not according
to your standards

Peter Niederwieser

unread,
Feb 9, 2012, 4:50:46 PM2/9/12
to Spock Framework - User
I'll see if I can get support for this into 0.6. It's a bit tricky
because AssumptionViolatedException is an internal class and was moved
from one package to another at some point.

By the way, Spock support categorizing tests out-of-the-box, although
this feature is not heavily advertised yet.

Cheers,
Peter

On Jan 26, 9:13 am, rulien <lien.runel...@gmail.com> wrote:
> Hey
>
> I have made a project to categorize tests github.com/rulien/categorize-
> test. In lack of a better feature in JUnit this relays on throwing
> AssumptionViolatedException in a MethodRule to be able to Ignore a
> test based on categories to run. This works in Junit because it
> ignores those tests if this happen
>
> In spock the BaseSpecRunner does not handle AssumptionViolated in the
> same way and therefore those tests fails. I made a fork of Spock and
> based change on the spock-0.5-groovy-1.8 tag (since it's this verision
> we are using). This can be seen herehttps://github.com/rulien/spock/tree/makejunitignoreproperly

Rune Lien

unread,
Feb 14, 2012, 6:25:12 AM2/14/12
to spockfr...@googlegroups.com
On Thu, Feb 9, 2012 at 10:50 PM, Peter Niederwieser <pnie...@gmail.com> wrote:
I'll see if I can get support for this into 0.6. It's a bit tricky
because AssumptionViolatedException is an internal class and was moved
from one package to another at some point.

By the way, Spock support categorizing tests out-of-the-box, although
this feature is not heavily advertised yet.

Yes i know but we want to have one way of categorizing test and not one pr test library (e.g junit and spock)
 

Cheers,
Peter

On Jan 26, 9:13 am, rulien <lien.runel...@gmail.com> wrote:
> Hey
>
> I have made a project to categorize tests github.com/rulien/categorize-
> test. In lack of a better feature in JUnit this relays on throwing
> AssumptionViolatedException in a MethodRule to be able to Ignore a
> test based on categories to run. This works in Junit because it
> ignores those tests if this happen
>
> In spock the BaseSpecRunner does not handle AssumptionViolated in the
> same way and therefore those tests fails. I made a fork of Spock and
> based change on the spock-0.5-groovy-1.8 tag (since it's this verision
> we are using). This can be seen herehttps://github.com/rulien/spock/tree/makejunitignoreproperly
>
> I don't know exactly how to make a pull request for this since I am
> not that familiar with your release cycle. But if you tell me how to
> do it properly I can do it. Or if you feel this change is appropriate
> you can merge it in yourself ?
>
> Please feel free to give feedback if the code is bad or not according
> to your standards

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To post to this group, send email to spockfr...@googlegroups.com.
To unsubscribe from this group, send email to spockframewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply all
Reply to author
Forward
0 new messages