Sha256: fad2eed14907cb7f90aaec98a1858f06e11b05ec2bc7aa95e4b468f4154fa9ed

Contents?: true

Size: 546 Bytes

Versions: 2

Compression:

Stored size: 546 Bytes

Contents

require_relative './../spec_helper.rb'

describe ROXML::XML do
  it "should escape invalid characters on output to text node" do
    node = ROXML::XML.new_node("entities")
    ROXML::XML.set_content(node, " < > ' \" & ")
    node.to_s.should == "<entities> &lt; &gt; ' \" &amp; </entities>"
  end

  it "should esape invalid characters for attribute name" do
    node = ROXML::XML.new_node("attr_holder")
    ROXML::XML.set_attribute(node, "entities", "\"'<>&")
    node.to_s.should == %{<attr_holder entities="&quot;'&lt;&gt;&amp;"/>}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roxml-3.3.1 spec/xml/parser_spec.rb
roxml-3.3.0 spec/xml/parser_spec.rb