~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to vendor/gems/rspec/spec/spec/mocks/record_messages_spec.rb

  • Committer: Bazaar Package Importer
  • Author(s): Micah Anderson
  • Date: 2008-07-26 15:43:45 UTC
  • mfrom: (1.1.8 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080726154345-c03m49twzxewdwjn
Tags: 0.24.5-2
* Fix puppetlast to work with 0.24.5
* Adjust logcheck to match against new log messages in 0.24.5
* Update standards version to 3.8.0 (no changes)
* Update changelog to reduce length of line to make lintian happy

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require File.dirname(__FILE__) + '/../../spec_helper'
 
2
 
 
3
module Spec
 
4
  module Mocks
 
5
    describe "a mock" do
 
6
      before(:each) do
 
7
        @mock = mock("mock", :null_object => true)
 
8
      end
 
9
      it "should answer false for received_message? when no messages received" do
 
10
        @mock.received_message?(:message).should be_false
 
11
      end
 
12
      it "should answer true for received_message? when message received" do
 
13
        @mock.message
 
14
        @mock.received_message?(:message).should be_true
 
15
      end
 
16
      it "should answer true for received_message? when message received with correct args" do
 
17
        @mock.message 1,2,3
 
18
        @mock.received_message?(:message, 1,2,3).should be_true
 
19
      end
 
20
      it "should answer false for received_message? when message received with incorrect args" do
 
21
        @mock.message 1,2,3
 
22
        @mock.received_message?(:message, 1,2).should be_false
 
23
      end
 
24
    end
 
25
  end
 
26
end