Verify that the classmethod stubs don't persist across blocks

This commit is contained in:
R. Tyler Croy 2012-02-14 09:49:56 -08:00
parent 9488b12033
commit ede3e2f824
1 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,11 @@ describe "stub methods" do
MyClass.stub(:a_class_method).and_return("a stubbed method")
MyClass.a_class_method.should match("a stubbed method")
end
it "should not persist class method stubs between blocks" do
MyClass.a_class_method.should match("default class impl")
end
it "invoking stub on class does not affect instance methods" do
MyClass.stub(:an_instance_method).and_return("a stubbed method")
inst = MyClass.new