Share mock logic in spock

Problem:
I have had a hard time doing copy/paste code in spock test that shares same setup logic.

Solution:
https://stackoverflow.com/questions/52521661/how-to-separate-tests-that-require-a-shared-mock

Documentation:
https://spockframework.org/spock/docs/1.3/all_in_one.html#_autoattach

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: