Class: Crspec::Mock::AllowTarget
- Inherits:
-
Object
- Object
- Crspec::Mock::AllowTarget
- Defined in:
- lib/crspec/mock/double.rb
Instance Method Summary collapse
-
#initialize(target) ⇒ AllowTarget
constructor
A new instance of AllowTarget.
- #to(matcher) ⇒ Object
Constructor Details
#initialize(target) ⇒ AllowTarget
Returns a new instance of AllowTarget.
346 347 348 |
# File 'lib/crspec/mock/double.rb', line 346 def initialize(target) @target = target end |
Instance Method Details
#to(matcher) ⇒ Object
350 351 352 353 354 355 356 |
# File 'lib/crspec/mock/double.rb', line 350 def to(matcher) if matcher.respond_to?(:setup_allow) matcher.setup_allow(@target) else matcher.call(@target) end end |