aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arc.h
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-01-30 23:05:52 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2008-01-30 23:05:52 +0000
commitf774e01cdb34e339455671f51413ecdc6de3208d (patch)
tree544204b2e0924ac45d911e5f37eef540facd40d0 /lib/arc.h
parentb5c8a34aeff244ffe7a9f4bd5edf827495d0deea (diff)
Fixed handling of OSCAR multi-part messages... They're not arrays, they're
linked lists!
Diffstat (limited to 'lib/arc.h')
0 files changed, 0 insertions, 0 deletions
e='hotfix/0.19.0.4'>hotfix/0.19.0.4 Unnamed repository; edit this file 'description' to name the repository.MimesBrønn
aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/gems/rspec-1.3.1/spec/spec/mocks/null_object_mock_spec.rb
blob: 8af6b49d75b65faac9686260e6e0580bc045464d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require 'spec_helper'

module Spec
  module Mocks
    describe "a mock acting as a NullObject" do
      before(:each) do
        @mock = Mock.new("null_object", :null_object => true)
      end

      it "should allow explicit expectation" do
        @mock.should_receive(:something)
        @mock.something
      end

      it "should fail verification when explicit exception not met" do
        lambda do
          @mock.should_receive(:something)
          @mock.rspec_verify
        end.should raise_error(MockExpectationError)
      end

      it "should ignore unexpected methods" do
        @mock.random_call("a", "d", "c")
        @mock.rspec_verify
      end

      it "should expected message with different args first" do
        @mock.should_receive(:message).with(:expected_arg)
        @mock.message(:unexpected_arg)
        @mock.message(:expected_arg)
      end

      it "should expected message with different args second" do
        @mock.should_receive(:message).with(:expected_arg)
        @mock.message(:expected_arg)
        @mock.message(:unexpected_arg)
      end
    end

    describe "#null_object?" do
      it "should default to false" do
        obj = mock('anything')
        obj.should_not be_null_object
      end
    end
    
    describe "#as_null_object" do
      it "should set the object to null_object" do
        obj = mock('anything').as_null_object
        obj.should be_null_object
      end
    end
  end
end