spockframework / spockframework/spock

Unmatched invocation description to include types

Open
#499 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module-Core Type-NewFeature
Dominant language
Java
Stars
3.6k
Forks
483
PR merge metrics
No merged PRs in 30d

Description

Originally reported on Google Code with ID 377

On some occasions I'll have a mock not match its interaction because of the types. One
problem is diagnosing it, because the output looks identical:

    Too few invocations for:

    1 * client.shareImages(['ami-12345de'], '12345678')   (0 invocations)

    Unmatched invocations (ordered by similarity):

    1 * client.shareImages(['ami-12345de'], '12345678')

Via pniederw@gmail.com: We should be able to come up with a better error message here.

Reported by quidryan on 2014-10-13 04:29:23

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by tracing Spock's unmatched invocation reporting and how it compares invocation argument types; reproduce the shown mock mismatch. Done means the diagnostic distinguishes type-based mismatches while preserving the existing invocation details, with regression coverage for the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.