diff options
Diffstat (limited to 'spec/ruby/library/rexml/attributes/element_reference_spec.rb')
-rw-r--r-- | spec/ruby/library/rexml/attributes/element_reference_spec.rb | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/spec/ruby/library/rexml/attributes/element_reference_spec.rb b/spec/ruby/library/rexml/attributes/element_reference_spec.rb index dac7952669..86e0c57fc9 100644 --- a/spec/ruby/library/rexml/attributes/element_reference_spec.rb +++ b/spec/ruby/library/rexml/attributes/element_reference_spec.rb @@ -1,18 +1,21 @@ require_relative '../../../spec_helper' -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 +ruby_version_is ''...'2.8' do + require 'rexml/document' - it "returns the value of an attribute" do - @e.attributes["language"].should == "english" - end + 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 + it "returns nil if the attribute does not exist" do + @e.attributes["chunky bacon"].should == nil + end end end |