spock icon indicating copy to clipboard operation
spock copied to clipboard

It would be handy to have a "global" where-block for @stepwise specifications

Open robfletcher opened this issue 10 years ago • 3 comments

Originally reported on Google Code with ID 285

Within a @Stepwise annotated specification it would be very convenient to have a central,
spec-wide where block to be able to define dataproviders for larger specs, which then
will be used run whole spec parameterized

could be in the setup methods or special method with a certain annotation

Reported by [email protected] on 2012-11-22 09:48:57

robfletcher avatar Aug 30 '15 15:08 robfletcher

I think that not only makes sense for stepwise specifications.

It would be great to have spec wide parameterization like it's possible with JUnit
parameterized tests. In our case we'd like to test multiple targets against a common
spec consisting of multiple tests. As instantiating these targets is expensive, it
doesn't make sense to iterate data driven over the targets for every single test. Instead
there could be a @Shared def target that only changes per global spec iteration.

Reported by [email protected] on 2014-07-15 13:01:53

robfletcher avatar Aug 30 '15 15:08 robfletcher

It definitely makes sense as a general feature, but designing and implementing it won't
be trivial. If you are interested in contributing, please let us know.

Reported by pniederw on 2014-07-15 13:07:10

robfletcher avatar Aug 30 '15 15:08 robfletcher

again came to the point where I wish I spock would have this. @robfletcher did you got your hands dirty on this? (fingers crossed)

breskeby avatar Apr 26 '18 14:04 breskeby