summaryrefslogtreecommitdiff
path: root/spec/rubyspec/library/rexml/attributes/element_reference_spec.rb
blob: 0e85ecafe8e80f4c00b52320a20157cd46615665 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require File.expand_path('../../../../spec_helper', __FILE__)
require 'rexml/document'

describe "REXML::Attributes#[]" do
  before :each do
    @e = REXML::Element.new("root")
    @lang = REXML::Attribute.new("language", "english")
    @e.attributes << @lang
  end

  it "returns the value of an attribute" do
    @e.attributes["language"].should == "english"
  end

  it "returns nil if the attribute does not exist" do
    @e.attributes["chunky bacon"].should == nil
  end
end