Sha256: 9d75f82a97d7e3e2f12c5a0eec1e17c2ba8e2abbd6bcbfe2e46264af1f376eb7

Contents?: true

Size: 695 Bytes

Versions: 8

Compression:

Stored size: 695 Bytes

Contents

require 'spec_helper'

describe "Double" do
  let(:test_double) { double }

  specify "when one example has an expectation inside the block passed to should_receive" do
    test_double.should_receive(:msg) do |arg|
      expect(arg).to be true #this call exposes the problem
    end
    begin
      test_double.msg(false)
    rescue Exception
    end
  end

  specify "then the next example should behave as expected instead of saying" do
    test_double.should_receive(:foobar)
    test_double.foobar
    verify test_double
    begin
      test_double.foobar
    rescue Exception => e
      expect(e.message).to eq "Double received unexpected message :foobar with (no args)"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rspec-mocks-2.99.4 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.99.3 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.99.2 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.99.1 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.99.0 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.99.0.rc1 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.99.0.beta2 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.99.0.beta1 spec/rspec/mocks/bug_report_10263_spec.rb