From e8d567252cca5861319ca088c03a3604986be060 Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Mon, 15 Sep 2008 08:32:58 -0500 Subject: [PATCH] added failing example of a post-stub mock receiving a block --- spec/spec/mocks/mock_spec.rb | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/spec/spec/mocks/mock_spec.rb b/spec/spec/mocks/mock_spec.rb index 5d329dd..b73b214 100644 --- a/spec/spec/mocks/mock_spec.rb +++ b/spec/spec/mocks/mock_spec.rb @@ -463,6 +463,15 @@ module Spec @calls.should == 1 end + it "should call the block after #should_receive after a similar stub" do + @mock.stub!(:foo).and_return(:bar) + @mock.should_receive(:foo) { add_call } + + @mock.foo + + @calls.should == 1 + end + it "should call the block after #once" do @mock.should_receive(:foo).once { add_call } -- 1.5.6.5