summaryrefslogtreecommitdiff
path: root/spec/ruby/library/rexml/attribute/to_string_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/rexml/attribute/to_string_spec.rb')
-rw-r--r--spec/ruby/library/rexml/attribute/to_string_spec.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/spec/ruby/library/rexml/attribute/to_string_spec.rb b/spec/ruby/library/rexml/attribute/to_string_spec.rb
index 420913afeb..f26c5b85f0 100644
--- a/spec/ruby/library/rexml/attribute/to_string_spec.rb
+++ b/spec/ruby/library/rexml/attribute/to_string_spec.rb
@@ -1,14 +1,17 @@
require_relative '../../../spec_helper'
-require 'rexml/document'
-describe "REXML::Attribute#to_string" do
- it "returns the attribute as XML" do
- attr = REXML::Attribute.new("name", "value")
- attr_empty = REXML::Attribute.new("name")
- attr_ns = REXML::Attribute.new("xmlns:ns", "http://uri")
+ruby_version_is ''...'2.8' do
+ require 'rexml/document'
- attr.to_string.should == "name='value'"
- attr_empty.to_string.should == "name=''"
- attr_ns.to_string.should == "xmlns:ns='http://uri'"
+ describe "REXML::Attribute#to_string" do
+ it "returns the attribute as XML" do
+ attr = REXML::Attribute.new("name", "value")
+ attr_empty = REXML::Attribute.new("name")
+ attr_ns = REXML::Attribute.new("xmlns:ns", "http://uri")
+
+ attr.to_string.should == "name='value'"
+ attr_empty.to_string.should == "name=''"
+ attr_ns.to_string.should == "xmlns:ns='http://uri'"
+ end
end
end