Any way to create a 'master' Spock test file that includes external Spock tests?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Any way to create a 'master' Spock test file that includes external Spock tests?

Les Hartzman
Hi,

Wondering if there is any way (can't find in the docs) that would allow you to develop individual tests and then incorporate them into a 'master' test that tests additional content than in the smaller tests, but needs them for completeness?

This would avoid the need to copy/paste Mocks/methods from the individual tests to the all-enclosing test file.

Thanks.

Les

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Any way to create a 'master' Spock test file that includes external Spock tests?

rfletcher
If I understand you correctly it sounds like something you could achieve with inheritance. If you have an abstract base Spec class with a bunch of feature methods in it you can add sub-classes with additional feature methods and all the ones from the superclass will get run as well. 

Typically you might use this for a suite of acceptance tests for an interface where you have multiple implementations – Spec sub-classes would create the @Subject instance but all the contract behaviors are specified in the abstract Spec.

On Thursday, September 3, 2015 at 2:13:00 PM UTC-7, Les Hartzman wrote:
Hi,

Wondering if there is any way (can't find in the docs) that would allow you to develop individual tests and then incorporate them into a 'master' test that tests additional content than in the smaller tests, but needs them for completeness?

This would avoid the need to copy/paste Mocks/methods from the individual tests to the all-enclosing test file.

Thanks.

Les

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.