Sha256: 228d471ab28a5b33cb62a5509434e7577d970ffe9e8d50725973fcce11f40349

Contents?: true

Size: 375 Bytes

Versions: 5

Compression:

Stored size: 375 Bytes

Contents

require 'rexml/document'

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

  it "returns true when element has any attributes" do
    @e.add_attribute("name", "Joe")
    @e.has_attributes?.should be_true
  end

  it "returns false if element has no attributes" do
    @e.has_attributes?.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_attributes_spec.rb
rubysl-rexml-2.0.3 spec/element/has_attributes_spec.rb
rubysl-rexml-1.0.0 spec/element/has_attributes_spec.rb
rubysl-rexml-2.0.2 spec/element/has_attributes_spec.rb
rubysl-rexml-2.0.1 spec/element/has_attributes_spec.rb