Replies: 1 comment 2 replies
-
That is currently not possible, and even with #1153 you'd end up having to repeat the sut declarations if you want to split per feature. The current recommended way, is what you have described. Individual specs have other advantages as well, i.e., they can be executed in isolation, and the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, is there a way to specify implementations the object under test without extending the spec multiple times?
What I have right now is something like this:
But I think that refactoring this into multiple specs for each feature would make things more readable, so I did something like this:
The problem I have is that I would have to extend SpecA and SpecB and provide the same implementation in init() like so:
The best I was able to do was this:
This turns ugly quickly. I would ideally want something like this:
Is this possible (and if possible, how?) or am I super abusing Spock?
Beta Was this translation helpful? Give feedback.
All reactions