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.



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