Hi Jeremy,

This is a bit more of a Spock question than Geb question so probably asking
on StackOverflow and tagging your question with spock would get you more
responses to it.

Anyhow, when I find myself wanting to apply code from setup() method in a
spec to only a subset of feature methods then I either:
- move the code from setup() into a different method and then call that
method at the top of each feature method I want the setup code to apply to
- split the spec into two - one which contains all of the methods that I
want the setup code in question applied to and one with methods that I
don't want the setup code applied to.

As far as I can tell there is no way to apply code from setup() to only a
subset of methods in the spec without splitting things up a bit.

Cheers,
Marcin

On Wed, Feb 5, 2020 at 2:30 PM jc <[email protected]> wrote:

> Just curious, let's say I have 20 tests in a class but 2 of the tests have
> slightly different requirements than what I have in the setup() method.  Is
> there a way to have those 2 tests skip the setup()?  I know I can just
> create separate methods and put them in the appropriate tests, but I was
> just curious if there was an easy way to skip setup(), if at all possible.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Geb User Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/e5cb2dde-aaa9-41c4-bb75-19c247108dd3%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/e5cb2dde-aaa9-41c4-bb75-19c247108dd3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/CA%2B52dQRwW7_G3EKyJoKdsPa7wfKqrZgqSMsQ6mc%2B%2BV6Yar-Bog%40mail.gmail.com.

Reply via email to