Skip to content

Commit

Permalink
issue rspec#137: unable to reproduce the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
aakashd committed May 23, 2012
1 parent aca2b40 commit 6f2c048
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/rspec/mocks/any_instance_spec.rb
Expand Up @@ -63,6 +63,24 @@ def private_method; :private_method_return_value; end
klass.any_instance.stub(:foo) klass.any_instance.stub(:foo)
lambda{ klass.new.bar }.should raise_error(NoMethodError) lambda{ klass.new.bar }.should raise_error(NoMethodError)
end 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 context 'multiple methods' do
it "allows multiple methods to be stubbed in a single invocation" do it "allows multiple methods to be stubbed in a single invocation" do
Expand Down

0 comments on commit 6f2c048

Please sign in to comment.