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.
254 255 256 |
# File 'lib/crspec/mock/double.rb', line 254 def initialize(target) @target = target end |
Instance Method Details
#to(matcher) ⇒ Object
258 259 260 261 262 263 264 |
# File 'lib/crspec/mock/double.rb', line 258 def to(matcher) if matcher.respond_to?(:setup_allow) matcher.setup_allow(@target) else matcher.call(@target) end end |