Class: FlexMock::CallRecord

Inherits:
Struct
  • Object
show all
Defined in:
lib/flexmock/call_record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



14
15
16
# File 'lib/flexmock/call_record.rb', line 14

def args
  @args
end

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



14
15
16
# File 'lib/flexmock/call_record.rb', line 14

def block
  @block
end

#expectationObject

Returns the value of attribute expectation

Returns:

  • (Object)

    the current value of expectation



14
15
16
# File 'lib/flexmock/call_record.rb', line 14

def expectation
  @expectation
end

#kwObject

Returns the value of attribute kw

Returns:

  • (Object)

    the current value of kw



14
15
16
# File 'lib/flexmock/call_record.rb', line 14

def kw
  @kw
end

#method_nameObject

Returns the value of attribute method_name

Returns:

  • (Object)

    the current value of method_name



14
15
16
# File 'lib/flexmock/call_record.rb', line 14

def method_name
  @method_name
end

Instance Method Details

#matches?(sym, expected_args, expected_kw, options) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
20
# File 'lib/flexmock/call_record.rb', line 15

def matches?(sym, expected_args, expected_kw, options)
  method_name == sym &&
    ArgumentMatching.all_match_args?(expected_args, args) &&
    ArgumentMatching.all_match_kw?(expected_kw, kw) &&
    matches_block?(options[:with_block])
end