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

#initialize(mock, method_name, arguments) ⇒ Invocation

Returns a new instance of Invocation.



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

#argumentsObject (readonly)

Returns the value of attribute arguments.



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

def arguments
  @arguments
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



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

def method_name
  @method_name
end

#mockObject (readonly)

Returns the value of attribute mock.



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

def mock
  @mock
end