lib/saml/kit/rspec/have_xpath.rb in saml-kit-1.0.9 vs lib/saml/kit/rspec/have_xpath.rb in saml-kit-1.0.10
- old
+ new
@@ -1,14 +1,9 @@
+# frozen_string_literal: true
+
RSpec::Matchers.define :have_xpath do |xpath|
match do |actual|
- namespaces = {
- "NameFormat": Saml::Kit::Namespaces::ATTR_SPLAT,
- "ds": ::Xml::Kit::Namespaces::XMLDSIG,
- "md": Saml::Kit::Namespaces::METADATA,
- "saml": Saml::Kit::Namespaces::ASSERTION,
- "samlp": Saml::Kit::Namespaces::PROTOCOL,
- }
- xml_document(actual).xpath(xpath, namespaces).any?
+ 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)}"
end