Sha256: 0a6addb8ed2882a2b450a2560f7f6d3252e63de3c8ad8c52afa4c9e747b1ba5c
Contents?: true
Size: 938 Bytes
Versions: 2
Compression:
Stored size: 938 Bytes
Contents
# encoding: UTF-8 require './test_helper' class NodeCommentTest < Minitest::Test def setup xp = XML::Parser.string('<root></root>') @doc = xp.parse assert_instance_of(XML::Document, @doc) @root = @doc.root end def test_libxml_node_add_pi_01 @root << XML::Node.new_pi('mypi') assert_equal '<root><?mypi?></root>', @root.to_s.gsub(/\n\s*/,'') end def test_libxml_node_add_pi_02 @root << XML::Node.new_pi('mypi') assert_equal 'pi', @root.child.node_type_name end def test_libxml_node_add_pi_03 @root << el = XML::Node.new_pi('mypi') el << "_this_is_added" assert_equal '<root><?mypi _this_is_added?></root>', @root.to_s.gsub(/\n\s*/,'') end def test_libxml_node_add_pi_04 @root << XML::Node.new_pi('mypi','mycontent') assert_equal '<root><?mypi mycontent?></root>', @root.to_s.gsub(/\n\s*/,'') end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
libxml-ruby-3.0.0-x64-mingw32 | test/tc_node_pi.rb |
libxml-ruby-3.0.0 | test/tc_node_pi.rb |