summaryrefslogtreecommitdiff
path: root/spec/ruby/library/rexml/element/has_elements_spec.rb
blob: dc5fc9c25b1cfb1d6f25f18995b1ffe3bb5a327d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'rexml/document'
require_relative '../../../spec_helper'

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