Sha256: 8ca5cd1949abf238bda83100b661cbf4dfabce1ee3027b7ef8d2210ec60ed2b4
Contents?: true
Size: 474 Bytes
Versions: 198
Compression:
Stored size: 474 Bytes
Contents
class BeAncestorOfMatcher def initialize(expected) @expected = expected end def matches?(actual) @actual = actual @expected.ancestors.include? @actual end def failure_message ["Expected #{@actual}", "to be an ancestor of #{@expected}"] end def negative_failure_message ["Expected #{@actual}", "not to be an ancestor of #{@expected}"] end end class Object def be_ancestor_of(expected) BeAncestorOfMatcher.new(expected) end end
Version data entries
198 entries across 174 versions & 4 rubygems