Sha256: 4d91a2b6f273c915380692faea785a92fdc24f5c79278b757b30f3a6b0cceb08

Contents?: true

Size: 408 Bytes

Versions: 5

Compression:

Stored size: 408 Bytes

Contents

require 'rexml/document'

describe "REXML::Attribute#xpath" do

  before :each do
    @e = REXML::Element.new "root"
    @attr = REXML::Attribute.new("year", "1989")
  end

  it "returns the path for Attribute" do
    @e.add_attribute @attr
    @attr.xpath.should == "root/@year"
  end

  it "raises an error if attribute has no parent" do
    lambda { @attr.xpath }.should raise_error(Exception)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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