stretchr / testify

A toolkit with common assertions and mocks that plays nicely with the standard library
MIT License
23.14k stars 1.59k forks source link

mock: add support for mock.Anything in slices #1577

Open andrewwillette opened 6 months ago

andrewwillette commented 6 months ago

Summary

Adds the ability for mock expectations to be defined with mock.Anything or mock.AnythingOfType as elements within a slice. This is mainly intended for variadic functions in a new PR for mockery, but can apply to any slice parameter.

Changes

Motivation

Help resolve this PR that had rebase needs.

Related issues

1348

dolmen commented 6 months ago

@andrewwillette I think that the mock needs a serious cleanup of its implementation before adding more features. Please give feedback on my #1578 proposal.