aboutsummaryrefslogtreecommitdiffstats
path: root/spec/rubyspec/library/rexml/attributes/shared/length.rb
blob: 94681882a6c3e0c95c592d6b3e733d12d1ed219c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require File.expand_path('../../../../../spec_helper', __FILE__)
require 'rexml/document'

describe :rexml_attribute_length, shared: true do
  it "returns the number of attributes" do
    e = REXML::Element.new("root")
    e.attributes.send(@method).should == 0

    e.attributes << REXML::Attribute.new("name", "John")
    e.attributes << REXML::Attribute.new("another_name", "Leo")
    e.attributes.send(@method).should == 2
  end
end