Skip to content

Instantly share code, notes, and snippets.

@ryanbrunner
Created April 2, 2012 22:00
Show Gist options
  • Save ryanbrunner/2287521 to your computer and use it in GitHub Desktop.
Save ryanbrunner/2287521 to your computer and use it in GitHub Desktop.
should_not_receive doesn't work when any_instance is used.
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