Created
July 6, 2012 17:56
-
-
Save rectalogic/3061649 to your computer and use it in GitHub Desktop.
Extend rspec with a method similar to should_receive but that invokes the original method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RSpec | |
module Mocks | |
module Methods | |
def should_receive_invoke(message, opts={}) | |
original_method = self.method(message.to_sym) | |
should_receive(message, opts) do |*args| | |
original_method.call(*args) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment