Sha256: b32022c6fffb5756dded5d628256a476a360b3058470fe333eebb90cf645ceab

Contents?: true

Size: 890 Bytes

Versions: 12

Compression:

Stored size: 890 Bytes

Contents

require 'spec_helper'

module Rspec
  module Mocks
    describe "a mock" do
      before(:each) do
        @mock = mock("mock", :null_object => true)
      end
      it "should answer false for received_message? when no messages received" do
        @mock.received_message?(:message).should be_false
      end
      it "should answer true for received_message? when message received" do
        @mock.message
        @mock.received_message?(:message).should be_true
      end
      it "should answer true for received_message? when message received with correct args" do
        @mock.message 1,2,3
        @mock.received_message?(:message, 1,2,3).should be_true
      end
      it "should answer false for received_message? when message received with incorrect args" do
        @mock.message 1,2,3
        @mock.received_message?(:message, 1,2).should be_false
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rspec-mocks-2.0.0.beta.4 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.beta.3 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.beta.2 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.beta.1 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.a10 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.a9 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.a8 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.a7 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.a6 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.a5 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.a4 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.a3 spec/rspec/mocks/record_messages_spec.rb