Sha256: 726f7f4f643895bd70bd8f841b23022e687395e581e30941a1384ff3922e85c9
Contents?: true
Size: 696 Bytes
Versions: 17
Compression:
Stored size: 696 Bytes
Contents
module Spec module Matchers class Has #:nodoc: def initialize(sym, *args) @sym = sym @args = args end def matches?(given) given.__send__(predicate, *@args) end def failure_message "expected ##{predicate}(#{@args[0].inspect}) to return true, got false" end def negative_failure_message "expected ##{predicate}(#{@args[0].inspect}) to return false, got true" end def description "have key #{@args[0].inspect}" end private def predicate "#{@sym.to_s.sub("have_","has_")}?".to_sym end end end end
Version data entries
17 entries across 17 versions & 5 rubygems