# File test/test_xml_shim.rb, line 12 def test_escape_string_with_nokogiri Splunk::require_xml_library(:nokogiri) assert_equal("<>'\"&", Splunk::escape_string("<>'\"&")) end
# File test/test_xml_shim.rb, line 7 def test_escape_string_with_rexml Splunk::require_xml_library(:rexml) assert_equal("<>'\"&", Splunk::escape_string("<>'\"&")) end
# File test/test_xml_shim.rb, line 27 def test_matches_with_nokogiri Splunk::require_xml_library(:nokogiri) m = Splunk::text_at_xpath("//msg", "<response><msg>Boris & Natasha</msg></response>") assert_equal("Boris & Natasha", m) end
# File test/test_xml_shim.rb, line 33 def test_matches_with_rexml Splunk::require_xml_library(:rexml) m = Splunk::text_at_xpath("//msg", "<response><msg>Boris & Natasha</msg></response>") assert_equal("Boris & Natasha", m) end
# File test/test_xml_shim.rb, line 22 def test_no_matches_with_nokogiri Splunk::require_xml_library(:nokogiri) assert_nil(Splunk::text_at_xpath("//msg", "<html>Hi</html>")) end
# File test/test_xml_shim.rb, line 17 def test_no_matches_with_rexml Splunk::require_xml_library(:rexml) assert_nil(Splunk::text_at_xpath("//msg", "<html>Hi</html>")) end