Sha256: 6be41f56fe705c23371c2f99ed909f67cb19f1516193e6029e3c545d7a5a1982

Contents?: true

Size: 473 Bytes

Versions: 5

Compression:

Stored size: 473 Bytes

Contents

require 'rexml/document'

describe "REXML::Attribute#remove" do
  before :each do
    @e = REXML::Element.new "Root"
    @attr = REXML::Attribute.new("foo", "bar")
  end

  it "deletes this Attribute from parent" do
    @e.add_attribute(@attr)
    @e.attributes["foo"].should_not == nil
    @attr.remove
    @e.attributes["foo"].should == nil
  end

  it "does not anything if element has no parent" do
    lambda {@attr.remove}.should_not raise_error(Exception)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubysl-rexml-2.0.4 spec/attribute/remove_spec.rb
rubysl-rexml-2.0.3 spec/attribute/remove_spec.rb
rubysl-rexml-1.0.0 spec/attribute/remove_spec.rb
rubysl-rexml-2.0.2 spec/attribute/remove_spec.rb
rubysl-rexml-2.0.1 spec/attribute/remove_spec.rb