Sha256: e5b130e1832bbb7c26286ad665628142a9bd03eb98bc688a50efa2080a06b401
Contents?: true
Size: 1.13 KB
Versions: 7
Compression:
Stored size: 1.13 KB
Contents
require_relative 'test_helper' require 'splunk-sdk-ruby' include Splunk class TestXMLShim < Test::Unit::TestCase def test_escape_string_with_rexml Splunk::require_xml_library(:rexml) assert_equal("<>'\"&", Splunk::escape_string("<>'\"&")) end def test_escape_string_with_nokogiri Splunk::require_xml_library(:nokogiri) assert_equal("<>'\"&", Splunk::escape_string("<>'\"&")) end def test_no_matches_with_rexml Splunk::require_xml_library(:rexml) assert_nil(Splunk::text_at_xpath("//msg", "<html>Hi</html>")) end def test_no_matches_with_nokogiri Splunk::require_xml_library(:nokogiri) assert_nil(Splunk::text_at_xpath("//msg", "<html>Hi</html>")) end 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 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 end
Version data entries
7 entries across 7 versions & 1 rubygems