Sha256: ce264bd3fa744f9d939d1bf881b7d2069f3e4e9acec37a40ea3419d2419d6b13

Contents?: true

Size: 698 Bytes

Versions: 5

Compression:

Stored size: 698 Bytes

Contents

require 'rexml/document'

describe "REXML::Element#whitespace" do
  it "returns true if whitespace is respected in the element" do
    e = REXML::Element.new("root")
    e.whitespace.should be_true

    e = REXML::Element.new("root", nil, :respect_whitespace => :all)
    e.whitespace.should be_true

    e = REXML::Element.new("root", nil, :respect_whitespace => ["root"])
    e.whitespace.should be_true
  end

  it "returns false if whitespace is ignored inside element" do
    e = REXML::Element.new("root", nil, :compress_whitespace => :all)
    e.whitespace.should be_false

    e = REXML::Element.new("root", nil, :compress_whitespace => ["root"])
    e.whitespace.should be_false
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubysl-rexml-2.0.4 spec/element/whitespace_spec.rb
rubysl-rexml-2.0.3 spec/element/whitespace_spec.rb
rubysl-rexml-1.0.0 spec/element/whitespace_spec.rb
rubysl-rexml-2.0.2 spec/element/whitespace_spec.rb
rubysl-rexml-2.0.1 spec/element/whitespace_spec.rb