pkg/mock should integrate with Invocation/Symbol #14725
Labels
area-pkg
Used for miscellaneous pkg/ packages not associated with specific area- teams.
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by @seaneagan
In LogEntry:
String methodName;
List arguments;
should be replaced with
Invocation invocation;
And the CallMatcher concept should be replaced with true Matchers against Invocations.
That way named arguments are supported, and less concepts and API surface are needed.
Then callsTo could support a Symbol as the member name, and could be implemented itself with noSuchMethod, allowing to use named arguments as well:
callsTo(#foo, new isInstanceOf<String>(), someNamedArg: isNotNull);
which would match calls like:
mock.foo('a String', someNamedArg: notNull);
The text was updated successfully, but these errors were encountered: