Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unroll parameterized features/tests by default - feature proposal #967

Open
szpak opened this Issue Jan 25, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@szpak
Copy link
Contributor

szpak commented Jan 25, 2019

Feature proposal - Unroll parameterized features/tests by default

Description

In most of the cases parameterized features/tests are more readable while unrolled. Even if the @Unroll annotation is placed at the specification/class level it's still boiler plate code to write. Following the common use cases it would be more natural to unroll all parameterized tests by default (with an option to disable it on per test or class basis).

Possible implementation

Starting with Spock 2.0 all parameterized tests would be unrolled by default. There would be still an ability to provide custom messages with the @Unroll("...") annotation. If desired the unrolling would be possible to disable for a test or the whole class with a dedicated annotation - @Roll).

Solutions for 1.x

There is the spock-global-unroll (global) extension which once added to classpath automatically unroll all parameterized tests in the whole projects. There is no need to add any extra code or annotation - all (parameter-less) @Unroll annotations can be removed.

It can be used as a preparation for Spock 2.0 with similar behavior available out-of-box.

Open topics

Feel free to leave comment in that issue.

@szpak szpak added this to the 2.0 milestone Jan 25, 2019

@ifqthenp

This comment has been minimized.

Copy link

ifqthenp commented Feb 26, 2019

Personally, I do not use @Unroll every time I run parametrized tests. Actually, last time I used @Unroll feature long time ago only to show to my colleague how cool Spock framework is.

I do not need to see detailed output for every test as long as tests run green. But when tests fail, Spock provides enough details to find failed test quickly even without @Unroll feature. For those willing to use @Unroll for every parametrized test I would recommend create some sort of live template or snippet in their favourite IDE or text editor.

My suggestion is to leave it as it is, there's no need to introduce breaking change for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.