spockframework / spockframework/spock
Description of unmatched invocations is blurry
Open
Nobody has claimed this yet.
Module-Core
Type-Enhancement
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 483
- PR merge metrics
- No merged PRs in 30d
Description
Originally reported on Google Code with ID 380
It would be awesome to see which invocation has not been matched.
Lack of knowledge which exact invocation was not matched.
When having such a block of code in Spock spec:
then:
1 * repository.persist({Something something ->
something.getAccount() == 12
something.getAmount() == 10
something.getLoan() == 123
something.getClientId() == 1234
})
when not matching for example getLoan() I receive such output:
Too few invocations for:
1 * repository.persist({Something something ->
something.getAccount() == 12
something.getAmount() == 10
something.getLoan() == 123
something.getClientId() == 1234
}) (0 invocations)
Unmatched invocations (ordered by similarity):
1 * repository.persist(Something[some toString() output])
Reported by marcin.grzejszczak on 2014-11-07 13:13:46
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 unmatched-invocation example in a Spock spec and inspect how the diagnostic is produced. No source file or test is named in the issue; done means the failure output identifies which argument or condition caused the invocation mismatch.
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
- Mostly clear
- Newbie friendliness
- 30/100