Sha256: 6411aa3ca43fc38d6f969405a5b36e8c6d7925a5bc6562c07e4e8c639d7cb400

Contents?: true

Size: 507 Bytes

Versions: 5

Compression:

Stored size: 507 Bytes

Contents

require 'rexml/document'

describe "REXML::Element#attribute" do
  it "returns an attribute by name" do
    person = REXML::Element.new "Person"
    attribute = REXML::Attribute.new("drink", "coffee")
    person.add_attribute(attribute)
    person.attribute("drink").should == attribute
  end

  it "supports attributes inside namespaces" do
    e = REXML::Element.new("element")
    e.add_attributes({"xmlns:ns" => "http://some_uri"})
    e.attribute("ns", "ns").to_s.should == "http://some_uri"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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