Class: Mocha::Invocation

Inherits:
Object
  • Object
show all
Defined in:
lib/bourne/invocation.rb

Overview

Used internally by Bourne extensions to Mocha. Represents a single invocation of a stubbed or mocked method. The mock, method name, and arguments are recorded and can be used to determine how a method was invoked.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Invocation) initialize(mock, method_name, arguments)



8
9
10
11
12
# File 'lib/bourne/invocation.rb', line 8

def initialize(mock, method_name, arguments)
  @mock        = mock
  @method_name = method_name
  @arguments   = arguments
end

Instance Attribute Details

- (Object) arguments (readonly)

Returns the value of attribute arguments



7
8
9
# File 'lib/bourne/invocation.rb', line 7

def arguments
  @arguments
end

- (Object) method_name (readonly)

Returns the value of attribute method_name



7
8
9
# File 'lib/bourne/invocation.rb', line 7

def method_name
  @method_name
end

- (Object) mock (readonly)

Returns the value of attribute mock



7
8
9
# File 'lib/bourne/invocation.rb', line 7

def mock
  @mock
end