Class: Spec::Expectations::Should::ItemHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/expectations/should/have.rb

Direct Known Subclasses

NegativeItemHandler, PositiveItemHandler

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ ItemHandler

Returns a new instance of ItemHandler.



102
103
104
# File 'lib/spec/expectations/should/have.rb', line 102

def initialize(target)
  @target = target
end

Instance Method Details

#fail_with(message) ⇒ Object



106
107
108
# File 'lib/spec/expectations/should/have.rb', line 106

def fail_with(message)
  Spec::Expectations.fail_with(message)
end

#wants_to_handle(sym) ⇒ Object



98
99
100
# File 'lib/spec/expectations/should/have.rb', line 98

def wants_to_handle(sym)
  @target.respond_to?("has_#{sym}?")
end