Sha256: eb2be4f11eb9940c58f23fd8c8c710a887d7fef148c15aa02f8cd176a2a57857

Contents?: true

Size: 651 Bytes

Versions: 5

Compression:

Stored size: 651 Bytes

Contents

require 'rexml/document'

describe "REXML::Attributes#prefixes" do
  before :each do
    @e = REXML::Element.new("root")
    a1 = REXML::Attribute.new("xmlns:a", "bar")
    a2 = REXML::Attribute.new("xmlns:b", "bla")
    a3 = REXML::Attribute.new("xmlns:c", "baz")
    @e.attributes << a1
    @e.attributes << a2
    @e.attributes << a3

    @e.attributes << REXML::Attribute.new("xmlns", "foo")
  end

  it "returns an array with the prefixes of each attribute" do
    @e.attributes.prefixes.sort.should == ["a", "b", "c"]
  end

  it "does not include the default namespace" do
    @e.attributes.prefixes.include?("xmlns").should == false
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubysl-rexml-2.0.4 spec/attributes/prefixes_spec.rb
rubysl-rexml-2.0.3 spec/attributes/prefixes_spec.rb
rubysl-rexml-1.0.0 spec/attributes/prefixes_spec.rb
rubysl-rexml-2.0.2 spec/attributes/prefixes_spec.rb
rubysl-rexml-2.0.1 spec/attributes/prefixes_spec.rb