Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds test to prevent regression of #69

* Bug fixed in a727464
* Closes #69
  • Loading branch information...
commit 328bd5df99946e69f110a65e244732fbbc6bfd95 1 parent 2c62796
@alindeman alindeman authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 spec/rspec/mocks/stub_implementation_spec.rb
View
13 spec/rspec/mocks/stub_implementation_spec.rb
@@ -56,6 +56,19 @@ def obj.foo; :original; end
obj.unstub(:foo)
obj.foo(3).should eq :three
end
+
+ it "restores the correct implementations when stubbed and unstubbed on a parent and child class" do
+ parent = Class.new
+ child = Class.new(parent)
+
+ parent.stub(:new)
+ child.stub(:new)
+ parent.unstub(:new)
+ child.unstub(:new)
+
+ parent.new.should be_an_instance_of parent
+ child.new.should be_an_instance_of child
+ end
it "raises a MockExpectationError if the method has not been stubbed" do
obj = Object.new
Please sign in to comment.
Something went wrong with that request. Please try again.