Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MockFactory reporting unexpected calls at the end of each test #253

Closed
wants to merge 1 commit into from

Conversation

KarelCemus
Copy link

Pull Request Checklist

  • I agree to licence my contributions under the MIT licence
  • [ ] I have added copyright headers to new files
  • I have added tests for any changed functionality

Fixes

Fixes #223

Purpose

Introduces MockFactoryRecordingUnexpectedCalls, which reports all unexpected calls after each test. This is usable especially with asynchronous tests since the original exception can be silently dropped.

Background Context

Why did you take this approach?

Fully backward compatible, records all unexpected call to be replayed later. Then optionally mixed in Factory verifies the empty call log of unexpected calls.

This approach is 1) backward compatible since it does not change current behavior, 2) still eagerly fails on an unexpected call, and 3) optionally fails again in the event the original failure was ignored.

@KarelCemus
Copy link
Author

The tests are not implemented right now, I'd like to receive some feedback first. Is its approach viable for you? Is there any chance to have this merged into the master?

@barkhorn barkhorn added this to the v4.2.0 milestone Dec 30, 2018
@KarelCemus
Copy link
Author

Is there anything I can do to move this on?

@barkhorn
Copy link
Collaborator

barkhorn commented Feb 1, 2019

Hi, I think this change looks fine in principle, but it doesn't yet have any tests. prerequisite to merging this would be to cover the new functionality in adequate tests, both for the standard case and for the new use-cases. Could you please add these? Then i'll review and give some more detailed feedback. Let's do this and then i'll cut a new release for Scalamock so people can use it

@barkhorn barkhorn modified the milestones: v4.2.0, v4.3.0 Apr 21, 2019
@barkhorn barkhorn removed this from the v4.3.0 milestone Jun 8, 2019
@barkhorn
Copy link
Collaborator

This is now way too old to merge. As stated a while ago, please add some testcases and rebase, then this should be fine to add

@barkhorn barkhorn closed this Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An unexpected call to one of the method of a mock doesn't always fails a test
2 participants