Sha256: b482522addf88ee79e36d1510993606b139691b47ef96cba0bbf28bfa3ec185c

Contents?: true

Size: 877 Bytes

Versions: 41

Compression:

Stored size: 877 Bytes

Contents

require 'spec_helper'

module RSpec
  module Mocks
    describe "a mock" do
      before(:each) do
        @mock = double("mock").as_null_object
      end
      it "answers false for received_message? when no messages received" do
        expect(@mock.received_message?(:message)).to be_false
      end
      it "answers true for received_message? when message received" do
        @mock.message
        expect(@mock.received_message?(:message)).to be_true
      end
      it "answers true for received_message? when message received with correct args" do
        @mock.message 1,2,3
        expect(@mock.received_message?(:message, 1,2,3)).to be_true
      end
      it "answers false for received_message? when message received with incorrect args" do
        @mock.message 1,2,3
        expect(@mock.received_message?(:message, 1,2)).to be_false
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 13 rubygems

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