summaryrefslogtreecommitdiff
path: root/spec/ruby/library/rexml/attributes/shared/length.rb
blob: 7848f9bf330e3edc19156d7972db18372dc813d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require_relative '../../../../spec_helper'
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