4 class RespondTo #:nodoc:
7 @names_not_responded_to = []
12 unless target.respond_to?(name)
13 @names_not_responded_to << name
16 return @names_not_responded_to.empty?
20 "expected target to respond to #{@names_not_responded_to.collect {|name| name.inspect }.join(', ')}"
23 def negative_failure_message
24 "expected target not to respond to #{@names.collect {|name| name.inspect }.join(', ')}"
28 "respond to ##{@names.to_s}"
33 # should respond_to(*names)
34 # should_not respond_to(*names)
36 # Matches if the target object responds to all of the names
37 # provided. Names can be Strings or Symbols.
41 def respond_to(*names)
42 Matchers::RespondTo.new(*names)