Class Mocks::Mock
In: lib/mocks/mock.rb
Parent: Object

Methods

Included Modules

Abstract

Attributes

mock_calls  [RW] 

Public Class methods

[Source]

# File lib/mocks/mock.rb, line 13
    def initialize
      @mock_calls = []
    end

Public Instance methods

[Source]

# File lib/mocks/mock.rb, line 33
    def mock_add ( elt )
      @mock_calls << elt unless @mock_calls.frozen?
    end

[Source]

# File lib/mocks/mock.rb, line 29
    def mock_args
      @mock_calls.map { |call| call.args }
    end

[Source]

# File lib/mocks/mock.rb, line 25
    def mock_calls_array
      @mock_calls.map { |call| call.to_a }
    end

[Source]

# File lib/mocks/mock.rb, line 41
    def mock_clear
      @mock_calls.clear
    end

[Source]

# File lib/mocks/mock.rb, line 37
    def mock_freeze
      @mock_calls.freeze
    end

[Source]

# File lib/mocks/mock.rb, line 17
    def mock_recall ( anObject )
      result = nil
      @mock_calls.each do |call|
        result = call.recall anObject
      end
      result
    end

[Source]

# File lib/mocks/mock.rb, line 45
    def mock_size
      @mock_calls.size
    end

[Validate]