@Use category is not available in where-block code
If you annotate a feature method with @Use, I'd expect the category also being applied to the where code, but this is not the case currently. You can only use it in other parts of the feature method.
Now have have another edge-case of a testing DSL. The where block is moved out of the method during compile time, into different helper methods as it must be available before the test itself is executed.
From the javadoc
Note:
@Usehas no effect when applied to a helper method. However, when applied to a spec class it will also affect its helper methods.
As the @Use is an extension and Spock doesn't offer an interception point around data providers I don't see a trivial way to fix this for methods, so you have to annotate the Spec.
Oh, hm. I was aware of all but the part about data provider methods not being interceptable. That's unfortunate of course. Maybe this would be a chance to add this capability. :-D
If not - which I fear - then please at least update the JavaDoc and documentation.
Even if the where block ends up as kind of helper method, this is not obvious to the user.
For a user the where block is part of the feature method, so it should be explicitly documented, that inside where blocks the annotation looses its meaning and that you either have to annotate the whole spec or use use(SomeCategory) { ... } inside the where block.