Sha256: aae24fe0da9c2994ac8aa4ae9231edcf11624875f22405ff55050fa94e91039f
Contents?: true
Size: 721 Bytes
Versions: 8
Compression:
Stored size: 721 Bytes
Contents
module Spec module Matchers class RespondTo #:nodoc: def initialize(sym) @sym = sym end def matches?(target) return target.respond_to?(@sym) end def failure_message "expected target to respond to #{@sym.inspect}" end def negative_failure_message "expected target not to respond to #{@sym.inspect}" end def description "respond to ##{@sym.to_s}" end end # :call-seq: # should respond_to(:sym) # should_not respond_to(:sym) # # Matches if the target object responds to :sym def respond_to(sym) Matchers::RespondTo.new(sym) end end end
Version data entries
8 entries across 8 versions & 3 rubygems