-
-
Notifications
You must be signed in to change notification settings - Fork 356
Conversation
Thanks, @JonRowe, I plan to review this in the morning. |
# | ||
# @example | ||
# | ||
# expect(api).to receive(:large_list).and_wrap_original do |original_method| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good for this to show that the block receives the method args and a block (if there is one).
The implementation looks great. I agree that it needs to have specs/cukes fleshed out more and it needs a changelog entry. |
bf193ae
to
530cece
Compare
Ping, added some specs and a feature. |
Feature: Wrapping the original implementation | ||
|
||
Use `and_wrap_original` to make a partial double response as it normally would. This can | ||
be useful when you want to expect a message without interfering with how it responds. You |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These sentences are confusing and inaccurate. It doesn't make it respond as it normally does...it makes it respond with whatever your block does (but your block has easy access to the original method). You use and_wrap_original
(over and_call_original
) specifically because you want to interfere with how it responds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew I forgot to change something :P
51c4a05
to
cb284c5
Compare
cb284c5
to
a05ebbf
Compare
@myronmarston I addressed your feedback, waiting for travis though |
Needs a changelog, then merge away once green. |
[skip ci]
This probably needs more specs and needs features but this converts
and_call_original
intoand_wrap_original
then usesand_wrap_original
to implement the oldand_call_original
(thus nicely proving it works!).Closes #650.