# encoding: UTF-8 require File.expand_path('../test_helper', __FILE__) class TestTextNode < Minitest::Test def test_content node = XML::Node.new_text('testdata') assert_instance_of(XML::Node, node) assert_equal('testdata', node.content) end def test_invalid_content error = assert_raises(TypeError) do XML::Node.new_text(nil) end assert_equal('wrong argument type nil (expected String)', error.to_s) end # We use the same facility that libXSLT does here to disable output escaping. # This lets you specify that the node's content should be rendered unaltered # whenever it is being output. This is useful for things like