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

Missing Stub Callback API #18

Open
jonathan-benn opened this issue Oct 18, 2017 · 0 comments
Open

Missing Stub Callback API #18

jonathan-benn opened this issue Oct 18, 2017 · 0 comments

Comments

@jonathan-benn
Copy link

The following Stub Callback API functions are missing:

stub.callsArg(index);
# Causes the stub to call the argument at the provided index as a callback function.
# stub.callsArg(0); causes the stub to call the first argument as a callback.

stub.callsArgWith(index, arg1, arg2, ...);
# Like callsArg, but with arguments to pass to the callback.

stub.yields([arg1, arg2, ...])
# Similar to callsArg.
# Causes the stub to call the first callback it receives with the provided arguments (if any).
# If a method accepts more than one callback, you need to use callsArg to have the stub
# invoke other callbacks than the first one.

stub.yieldsTo(property, [arg1, arg2, ...])
# Causes the spy to invoke a callback passed as a property of an object to the spy.
# Like yields, yieldsTo grabs the first matching argument, finds the callback and calls 
# it with the (optional) arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants