module Gauntlt::Support::XmlHelper

Public Instance Methods

assert_xml_does_not_include(filename, css) click to toggle source
# File lib/gauntlt/attack_adapters/support/xml_helper.rb, line 24
def assert_xml_does_not_include(filename, css)
  raise "#{css} found in #{filename}" unless xml_at_css(filename, css).nil?
end
assert_xml_includes(filename, css) click to toggle source
# File lib/gauntlt/attack_adapters/support/xml_helper.rb, line 20
def assert_xml_includes(filename, css)
  raise "#{css} not found in #{filename}" if xml_at_css(filename, css).nil?
end
load_xml_from_file(filename) click to toggle source
# File lib/gauntlt/attack_adapters/support/xml_helper.rb, line 6
def load_xml_from_file(filename)
  content = ""
  prep_for_fs_check do
    content = IO.read(filename)
  end
  Nokogiri::XML(content)
end
xml_at_css(filename, css) click to toggle source
# File lib/gauntlt/attack_adapters/support/xml_helper.rb, line 15
def xml_at_css(filename, css)
  xml = load_xml_from_file(filename)
  xml.at_css(css)
end