Sha256: 265be700926406735c0d06274a4939fdf70a1269938a04ccaaa623ae1fd50205

Contents?: true

Size: 920 Bytes

Versions: 10

Compression:

Stored size: 920 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

module Spec
  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

10 entries across 10 versions & 1 rubygems

Version Path
rspec-0.9.0 spec/spec/mocks/record_messages_spec.rb
rspec-0.9.1 spec/spec/mocks/record_messages_spec.rb
rspec-0.9.2 spec/spec/mocks/record_messages_spec.rb
rspec-0.9.3 spec/spec/mocks/record_messages_spec.rb
rspec-0.9.4 spec/spec/mocks/record_messages_spec.rb
rspec-1.0.0 spec/spec/mocks/record_messages_spec.rb
rspec-1.0.1 spec/spec/mocks/record_messages_spec.rb
rspec-1.0.2 spec/spec/mocks/record_messages_spec.rb
rspec-1.0.3 spec/spec/mocks/record_messages_spec.rb
rspec-1.0.4 spec/spec/mocks/record_messages_spec.rb