Skip to content
This repository was archived by the owner on Feb 16, 2018. It is now read-only.

pkg/mock should integrate with Invocation/Symbol #2

Open
DartBot opened this issue Jun 4, 2015 · 5 comments
Open

pkg/mock should integrate with Invocation/Symbol #2

DartBot opened this issue Jun 4, 2015 · 5 comments

Comments

@DartBot
Copy link

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="96" height="96"hspace="10"> Issue by seaneagan
Originally opened as dart-lang/sdk#14725


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);

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/2108507?v=3" align="left" width="48" height="48"hspace="10"> Comment by dgrove


Added Area-UnitTest, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

This comment was originally written by [email protected]


I'm stuck with my unittesting to the point, where I have to check the named arguments passed to a mock.
I can't find a workaround, so I hope this issue is gonna be addressed soon.

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo


Removed Area-UnitTest label.
Added Area-Pkg, Pkg-Unittest labels.

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo


Removed Pkg-Unittest label.
Added Pkg-mock label.

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo


Removed Type-Defect label.
Added Type-Enhancement label.
Changed the title to: "pkg/mock should integrate with Invocation/Symbol".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant