Sha256: e04b745e4245e07085b1201c89fc621ae00108ec747455c241fa2793fbddd033

Contents?: true

Size: 935 Bytes

Versions: 4

Compression:

Stored size: 935 Bytes

Contents

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

module Spec
  module Mocks
    context "a mock" do
      setup do
        @mock = mock("mock", :null_object => true)
      end
      specify "should answer false for received_message? when no messages received" do
        @mock.received_message?(:message).should be(false)
      end
      specify "should answer true for received_message? when message received" do
        @mock.message
        @mock.received_message?(:message).should be(true)
      end
      specify "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
      specify "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 & 2 rubygems

Version Path
riess-0.0.8 vendor/rspec-0.8.2/spec/spec/mocks/record_messages_spec.rb
rspec-0.8.0 spec/spec/mocks/record_messages_spec.rb
rspec-0.8.1 spec/spec/mocks/record_messages_spec.rb
rspec-0.8.2 spec/spec/mocks/record_messages_spec.rb