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

Entities: Spy arguments storing refactoring #1

Merged
merged 3 commits into from
May 8, 2020

Conversation

merindorium
Copy link
Owner

The current approach of storing call arguments directly in Spy is not flexible enough.
This PR adds MethodCall entity that stores call arguments.
Now Spy stores an array of method calls. That gives us the ability to count calls out-of-box and now Spy stores all calls instead of the last one.

@merindorium merindorium self-assigned this May 8, 2020
@merindorium merindorium added the API Break Changes in library public API label May 8, 2020
@merindorium merindorium marked this pull request as ready for review May 8, 2020 18:09
@merindorium merindorium changed the title Entities: Spy call refactoring Entities: Spy arguments storing refactoring May 8, 2020
The current approach of storing call arguments directly in `Spy` is
not flexible enough.
This commit adds `MethodCall` entity that stores call arguments.
Now `Spy` stores an array of method calls. That gives us the ability
to count calls out-of-box and now `Spy` stores all calls instead of the
last one.
- Add `asSafe` public method that safely casts stored value to expected type.
- Remove redundant `cast` method.
Update code examples according to API changes.
@merindorium merindorium merged commit a59dff2 into master May 8, 2020
@merindorium merindorium deleted the pr-spy-call-refactoring branch May 8, 2020 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Break Changes in library public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant