Class: Crspec::Mock::AllowTarget

Inherits:
Object
  • Object
show all
Defined in:
lib/crspec/mock/double.rb

Instance Method Summary collapse

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