Sha256: cf3cf971e958859ead532f8a85a1f6d80a5875b70f80ed93a9c19a667a67626f

Contents?: true

Size: 427 Bytes

Versions: 5

Compression:

Stored size: 427 Bytes

Contents

require 'rexml/document'

describe "REXML::Text.read_with_substitution" do
  it "reads a text and escapes entities" do
    REXML::Text.read_with_substitution("&lt; &gt; &amp; &quot; &apos;").should == "< > & \" '"
  end

  it "accepts an regex for invalid expressions and raises an error if text matches" do
    lambda {REXML::Text.read_with_substitution("this is illegal", /illegal/)}.should raise_error(Exception)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubysl-rexml-2.0.4 spec/text/read_with_substitution_spec.rb
rubysl-rexml-2.0.3 spec/text/read_with_substitution_spec.rb
rubysl-rexml-1.0.0 spec/text/read_with_substitution_spec.rb
rubysl-rexml-2.0.2 spec/text/read_with_substitution_spec.rb
rubysl-rexml-2.0.1 spec/text/read_with_substitution_spec.rb