felangel / mocktail

A mock library for Dart inspired by mockito
https://pub.dev/packages/mocktail
MIT License
588 stars 80 forks source link

docs(mocktail): update `README.md` to include `any(that: ...)` #226

Closed rocboronat closed 5 months ago

rocboronat commented 5 months ago

Status

READY

Breaking Changes

NO

Description

Last week I messed a lot trying to validate a method that received a parameter type outside my control was called. As that type didn't have equals overridden, mocktail never detected that the parameter was passed. So I had to use another strategy to check if that parameter was passed: to specify which attributes of the type to check.

I'm adding that strategy here as an example to help others. It's actually not mocktail documentation, but mocktail can also use that strategy, so it will save lives.

Type of Change