Class: RSpec::Matchers::DelegateMatcher::StubDelegate
- Defined in:
- lib/delegate_matcher/stub_delegate.rb
Instance Attribute Summary collapse
-
#return_value ⇒ Object
readonly
Returns the value of attribute return_value.
Attributes inherited from Delegate
Attributes included from Block
Instance Method Summary collapse
-
#initialize(expected, to) ⇒ StubDelegate
constructor
A new instance of StubDelegate.
Methods inherited from Delegate
#argument_description, #receiver
Methods included from Block
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_value ⇒ Object
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 |