Class: RSpec::Matchers::DelegateMatcher::NilDelegate
- Defined in:
- lib/delegate_matcher/nil_delegate.rb
Instance Attribute Summary
Attributes inherited from Delegate
Attributes included from Block
Instance Method Summary collapse
-
#initialize(expected, to, &block) ⇒ NilDelegate
constructor
A new instance of NilDelegate.
Methods inherited from Delegate
#argument_description, #receiver
Methods included from Block
Constructor Details
#initialize(expected, to, &block) ⇒ NilDelegate
Returns a new instance of NilDelegate.
5 6 7 8 9 10 11 12 |
# File 'lib/delegate_matcher/nil_delegate.rb', line 5 def initialize(expected, to, &block) super original_receiver = receiver self.receiver = nil block.call ensure self.receiver = original_receiver end |