-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Stub and yield passed block #495
Comments
@andyw8 The |
Yeah, I understand that |
For context here's where I'm using it: |
There already is such an example: mocha/lib/mocha/expectation.rb Line 274 in 0085b60
|
Thanks, @nitishr. Yes, that was my assumption too. I'm always keen to improve the documentation and so if separating the examples makes things clearer then I'm in favour of it. In fact in this case, it might be clearer not to call |
With a particular focus on clarifying the behaviour of Expectation#yields with no arguments. Closes #495.
Yeah, I think focusing on just the |
Thanks. I've already merged something along those lines in d590812. |
With a particular focus on clarifying the behaviour of Expectation#yields with no arguments. Closes #495.
I was looking for way to stub a method and simply yield the block.
After trying some awkward approaches, I discovered this works with simply
stubs(:foo).yields
, but this form without arguments doesn't seem be documented:https://www.rubydoc.info/github/floehopper/mocha/Mocha%2FExpectation:yields
If this is a valid use then I can submit a PR to update the docs.
The text was updated successfully, but these errors were encountered: