Sha256: f7c3fac91ebd30b1936e187c054fe6390e5983fe3cbb4873cc72ae1c057f08e9

Contents?: true

Size: 871 Bytes

Versions: 63

Compression:

Stored size: 871 Bytes

Contents

require 'spec_helper'

module RSpec
  module Mocks
    describe "Example with stubbed and then called message" do
      it "fails if the message is expected and then subsequently not called again" do
        double = double("mock", :msg => nil)
        double.msg
        double.should_receive(:msg)
        lambda { double.rspec_verify }.should raise_error(RSpec::Mocks::MockExpectationError)
      end

      it "outputs arguments of all similar calls" do
        double = double('double', :foo => true)
        double.should_receive(:foo).with('first')
        double.foo('second')
        double.foo('third')
        lambda do
          double.rspec_verify
        end.should raise_error(%Q|Double "double" received :foo with unexpected arguments\n  expected: ("first")\n       got: ("second"), ("third")|)
        double.rspec_reset
      end
    end
    
  end
end

Version data entries

63 entries across 61 versions & 7 rubygems

Version Path
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/rspec-mocks-2.8.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/rspec-mocks-2.8.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-mocks-2.8.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-mocks-2.8.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
rspec-mocks-2.8.0 spec/rspec/mocks/stubbed_message_expectations_spec.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
rspec-mocks-2.8.0.rc2 spec/rspec/mocks/stubbed_message_expectations_spec.rb
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
rspec-mocks-2.8.0.rc1 spec/rspec/mocks/stubbed_message_expectations_spec.rb
rspec-mocks-2.7.0 spec/rspec/mocks/stubbed_message_expectations_spec.rb
rspec-mocks-2.7.0.rc1 spec/rspec/mocks/stubbed_message_expectations_spec.rb
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rspec-mocks-2.5.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rspec-mocks-2.5.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb