Sha256: 549203ac7550bb64242cc3516e8952682282c6af1ad24e64c4d1add8a0a619ec

Contents?: true

Size: 921 Bytes

Versions: 102

Compression:

Stored size: 921 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

102 entries across 102 versions & 14 rubygems

Version Path
dchelimsky-rspec-1.1.10 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.11.1 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.11.2 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.11.3 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.11.4 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.11.5 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.11.6 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.11.7 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.12 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.1 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.13 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.2 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.3 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.4 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.5 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.6 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.7 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.8 spec/spec/mocks/record_messages_spec.rb
dchelimsky-rspec-1.1.99.9 spec/spec/mocks/record_messages_spec.rb