Sha256: 0a3a88bf98004e31d1bef4bf7bdc8ddeef58f2e0e8c044a05d4c9410602d7735

Contents?: true

Size: 665 Bytes

Versions: 16

Compression:

Stored size: 665 Bytes

Contents

describe "Mock" do
  before do
    @mock = mock("test mock")
  end
  
  specify "when one example has an expectation (non-mock) inside the block passed to the mock" do
    @mock.should_receive(:msg) do |b|
      b.should be_true #this call exposes the problem
    end
    begin
      @mock.msg(false)
    rescue Exception
    end
  end
  
  specify "then the next example should behave as expected instead of saying" do
    @mock.should_receive(:foobar)
    @mock.foobar
    @mock.rspec_verify
    begin
      @mock.foobar
    rescue Exception => e
      e.message.should == "Mock 'test mock' received unexpected message :foobar with (no args)"
    end
  end 
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
rspec-mocks-2.0.0.beta.4 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.beta.3 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.beta.2 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.beta.1 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a10 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a9 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a8 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a7 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a6 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a5 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a4 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a3 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a2 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.0.0.a1 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-1.2.7 spec/spec/mocks/bug_report_10263_spec.rb
rspec-1.2.8 spec/spec/mocks/bug_report_10263_spec.rb