spockframework / spockframework/spock
Allow @Shared fields in traits mixed into Spock Specifications
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 483
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I tried to refactor common behaviour into traits and reuse them by implementing them in my Specifications. I noticed that Spock does not handle @Shared fields declared in a trait.
Would it be possible to support this?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported case: a Spock Specification implementing a trait that declares an @Shared field. Trace how shared fields are handled during the specification lifecycle and add regression coverage; done means the trait's @Shared field behaves like one declared directly in the Specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, java
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100