Class: RSpec::Matchers::DelegateMatcher::StubDelegate

Inherits:
Delegate
  • Object
show all
Defined in:
lib/delegate_matcher/stub_delegate.rb

Instance Attribute Summary collapse

Attributes inherited from Delegate

#args, #received, #to

Attributes included from Block

#block

Instance Method Summary collapse

Methods inherited from Delegate

#argument_description, #receiver

Methods included from Block

#block_source

Constructor Details

#initialize(expected, to) ⇒ StubDelegate

Returns a new instance of StubDelegate.



9
10
11
12
13
# File 'lib/delegate_matcher/stub_delegate.rb', line 9

def initialize(expected, to)
  super
  self.return_value = receiver.send(expected.as, *expected.args)
  stub_receiver
end

Instance Attribute Details

#return_valueObject

Returns the value of attribute return_value.



7
8
9
# File 'lib/delegate_matcher/stub_delegate.rb', line 7

def return_value
  @return_value
end