lib/saml/kit/rspec/have_xpath.rb in saml-kit-1.0.15 vs lib/saml/kit/rspec/have_xpath.rb in saml-kit-1.0.16

- old
+ new

@@ -4,14 +4,16 @@ match do |actual| xml_document(actual).xpath(xpath, Saml::Kit::Document::NAMESPACES).any? end failure_message do |actual| - "Expected xpath: #{xpath.inspect} to match in:\n #{xml_pretty_print(actual)}" + xml = xml_pretty_print(actual) + "Expected xpath: #{xpath.inspect} to match in:\n #{xml}" end failure_message_when_negated do |actual| - "Expected xpath: #{xpath.inspect} not to match in:\n #{xml_pretty_print(actual)}" + xml = xml_pretty_print(actual) + "Expected xpath: #{xpath.inspect} not to match in:\n #{xml}" end def xml_pretty_print(raw_xml) xml_document(raw_xml).to_xml(indent: 2) end