Sha256: 90f64fecf9a09f86c1344e7046932082f3b5f3f0f4ab41e489defdc6cbb8fdef

Contents?: true

Size: 392 Bytes

Versions: 5

Compression:

Stored size: 392 Bytes

Contents

require 'rexml/document'

describe "REXML::Element#has_elements?" do
  before :each do
    @e = REXML::Element.new("root")
  end

  it "returns true if element has child elements" do
    child = REXML::Element.new("child")
    @e << child
    @e.has_elements?.should be_true
  end

  it "returns false if element doesn't have child elements" do
    @e.has_elements?.should be_false
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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