Skip to content
Browse files

issue #137: unable to reproduce the issue

  • Loading branch information...
1 parent aca2b40 commit 6f2c04831faa685a1de003ffded3f5b851f0c931 @aakashd aakashd committed
Showing with 18 additions and 0 deletions.
  1. +18 −0 spec/rspec/mocks/any_instance_spec.rb
View
18 spec/rspec/mocks/any_instance_spec.rb
@@ -63,6 +63,24 @@ def private_method; :private_method_return_value; end
klass.any_instance.stub(:foo)
lambda{ klass.new.bar }.should raise_error(NoMethodError)
end
+
+ context "multiple return values" do
+ it "handles multiple return values" do
+ klass.any_instance.stub(:foo).and_return(:one,:two,:three)
+ instance = klass.new
+ instance.foo.should eq(:one)
+ instance.foo.should eq(:two)
+ instance.foo.should eq(:three)
+ end
+
+ it "returns the same value" do
+ klass.any_instance.stub(:foo).and_return(:one,:two,:three)
+ instance = klass.new
+ another_instance = klass.new
+ instance.foo.should eq(:one)
+ another_instance.foo.should eq(:one)
+ end
+ end
context 'multiple methods' do
it "allows multiple methods to be stubbed in a single invocation" do

0 comments on commit 6f2c048

Please sign in to comment.
Something went wrong with that request. Please try again.