Created
April 2, 2012 22:00
-
-
Save ryanbrunner/2287521 to your computer and use it in GitHub Desktop.
should_not_receive doesn't work when any_instance is used.
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
class Foo | |
def bar | |
puts "bar!" | |
end | |
end | |
describe Foo do | |
# This test will pass with rspec 2.9.0. An instance of Foo is receiving bar, | |
# so shouldn't it fail? | |
it "should not recieve bar" do | |
Foo.any_instance.should_not_receive :bar | |
Foo.new.bar | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment