Created
October 21, 2014 09:29
-
-
Save fables-tales/9da4777150cf958ba5b9 to your computer and use it in GitHub Desktop.
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
def bar | |
puts "welp" | |
end | |
def foo | |
bar | |
end | |
RSpec.describe "foo" do | |
it "calls bar" do | |
expect(self).to receive(:bar) | |
foo | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@itgsoddabe the double is a different object, so it doesn't receive anything. If you want to use the
have_received
style of expectation you'd do this:If you do want to use the double you could also do this: