diff options
Diffstat (limited to 'spec/ruby/library/rexml/document/clone_spec.rb')
-rw-r--r-- | spec/ruby/library/rexml/document/clone_spec.rb | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/spec/ruby/library/rexml/document/clone_spec.rb b/spec/ruby/library/rexml/document/clone_spec.rb index 4aebb6f156..2106c72888 100644 --- a/spec/ruby/library/rexml/document/clone_spec.rb +++ b/spec/ruby/library/rexml/document/clone_spec.rb @@ -1,20 +1,23 @@ -require 'rexml/document' require_relative '../../../spec_helper' -# According to the MRI documentation (http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/index.html), -# clone's behavior "should be obvious". Apparently "obvious" means cloning -# only the attributes and the context of the document, not its children. -describe "REXML::Document#clone" do - it "clones document attributes" do - d = REXML::Document.new("foo") - d.attributes["foo"] = "bar" - e = d.clone - e.attributes.should == d.attributes - end +ruby_version_is ''...'2.8' do + require 'rexml/document' + + # According to the MRI documentation (http://www.ruby-doc.org/stdlib/libdoc/rexml/rdoc/index.html), + # clone's behavior "should be obvious". Apparently "obvious" means cloning + # only the attributes and the context of the document, not its children. + describe "REXML::Document#clone" do + it "clones document attributes" do + d = REXML::Document.new("foo") + d.attributes["foo"] = "bar" + e = d.clone + e.attributes.should == d.attributes + end - it "clones document context" do - d = REXML::Document.new("foo", {"foo" => "bar"}) - e = d.clone - e.context.should == d.context + it "clones document context" do + d = REXML::Document.new("foo", {"foo" => "bar"}) + e = d.clone + e.context.should == d.context + end end end |