Sha256: 12037bf0621b2b7d742a244ae859074eb5248f874d9f3710a117014b00354b82

Contents?: true

Size: 440 Bytes

Versions: 5

Compression:

Stored size: 440 Bytes

Contents

require 'rexml/document'

describe "REXML::Element#attributes" do
  it "returns element's Attributes" do
    p = REXML::Element.new "Person"

    name = REXML::Attribute.new("name", "John")
    attrs = REXML::Attributes.new(p)
    attrs.add name

    p.add_attribute name
    p.attributes.should == attrs
  end

  it "returns an empty hash if element has no attributes" do
    REXML::Element.new("Person").attributes.should == {}
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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