Sha256: 1a189abf9af634f2d19348ea96ce6ef7bf4671203a3ddc274b5b8e4acef4262a

Contents?: true

Size: 892 Bytes

Versions: 4

Compression:

Stored size: 892 Bytes

Contents

require 'spec_helper'

module Rspec
  module Mocks
    describe "a mock" do
      before(:each) do
        @mock = double("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

4 entries across 4 versions & 1 rubygems

Version Path
rspec-mocks-2.0.0.beta.8 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.beta.7 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.beta.6 spec/rspec/mocks/record_messages_spec.rb
rspec-mocks-2.0.0.beta.5 spec/rspec/mocks/record_messages_spec.rb