Sha256: d0ceafa7b619d001c1704b0da79745243bb0b400523e7762f2905ffb48efe07e
Contents?: true
Size: 698 Bytes
Versions: 7
Compression:
Stored size: 698 Bytes
Contents
module Matchers class DisambiguateAttributes def initialize(attributes) @attributes = attributes end def matches?(actual) @actual = actual attribute1, attribute2 = @attributes @actual[attribute1].descends_from?(attribute1) && !@actual[attribute1].descends_from?(attribute2) && @actual[attribute2].descends_from?(attribute2) end def failure_message "" # "expected #{@actual} to disambiguate its attributes" end def negative_failure_message "expected #{@actual} to not disambiguate its attributes" end end def disambiguate_attributes(*attributes) DisambiguateAttributes.new(attributes) end end
Version data entries
7 entries across 7 versions & 2 rubygems