Sha256: c80b6b9c48c0a98aa1418de9fcedbddd7c6d375d8787fc5d8fbcf0a83bc5ed7a

Contents?: true

Size: 695 Bytes

Versions: 30

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

30 entries across 30 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_10263_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_10263_spec.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_10263_spec.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_10263_spec.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_10263_spec.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_10263_spec.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_10263_spec.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_10263_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-mocks-2.14.6/spec/rspec/mocks/bug_report_10263_spec.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.14.6 spec/rspec/mocks/bug_report_10263_spec.rb
rspec-mocks-2.14.5 spec/rspec/mocks/bug_report_10263_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_10263_spec.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_10263_spec.rb
dxruby_rp5-0.0.3 spec/vendor/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_10263_spec.rb
tuktuk-rails-0.0.10 vendor/bundle/ruby/2.0.0/gems/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_10263_spec.rb
tuktuk-rails-0.0.9 vendor/bundle/ruby/2.0.0/gems/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_10263_spec.rb
tuktuk-rails-0.0.8 vendor/bundle/ruby/2.0.0/gems/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_10263_spec.rb
tuktuk-rails-0.0.7 vendor/bundle/ruby/2.0.0/gems/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_10263_spec.rb
dxruby_rp5-0.0.2 spec/vendor/rspec-mocks-2.14.4/spec/rspec/mocks/bug_report_10263_spec.rb