class Xml::C14n::RSpecMatchers::AnalogousMatcher
def diffable
def diffable true end
def failure_message
def failure_message index = 0 @result.map do |hash| index += 1 "DIFF #{index}: expected node: #{hash[:node1]}\n" \ " actual node : #{hash[:node2]}\n" \ " diff from : #{hash[:diff1]}\n" \ " diff to : #{hash[:diff2]}\n" end.join("\n") end
def failure_message_when_negated
def failure_message_when_negated ["expected:", @target.to_s, "not be analogous with:", @expected.to_s].join("\n") end
def initialize(expected)
def initialize(expected) @expected = expected @result = nil end
def matches?(target)
def matches?(target) @target = target @result = CompareXML.equivalent?( Nokogiri::XML(@target), Nokogiri::XML(@expected), { collapse_whitespace: true, ignore_attr_order: true, verbose: true }, ) @result.empty? end