summaryrefslogtreecommitdiff
path: root/spec/ruby/library/rexml/cdata/initialize_spec.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2020-01-12 08:14:26 +0900
committerSHIBATA Hiroshi <[email protected]>2020-01-12 12:28:29 +0900
commite61cab3a367c4040a2a487dd893c7be9a37889a9 (patch)
treec6ea3e3c929fcb5fd17197abea387173912f624b /spec/ruby/library/rexml/cdata/initialize_spec.rb
parent83240f315a10b42b53c3b62c1fbc428f97912665 (diff)
Ignore rexml examples on ruby/spec
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2832
Diffstat (limited to 'spec/ruby/library/rexml/cdata/initialize_spec.rb')
-rw-r--r--spec/ruby/library/rexml/cdata/initialize_spec.rb37
1 files changed, 20 insertions, 17 deletions
diff --git a/spec/ruby/library/rexml/cdata/initialize_spec.rb b/spec/ruby/library/rexml/cdata/initialize_spec.rb
index 0184440d87..2ef1cab2b3 100644
--- a/spec/ruby/library/rexml/cdata/initialize_spec.rb
+++ b/spec/ruby/library/rexml/cdata/initialize_spec.rb
@@ -1,24 +1,27 @@
require_relative '../../../spec_helper'
-require 'rexml/document'
-describe "REXML::CData#initialize" do
- it "creates a new CData object" do
- c = REXML::CData.new("some text")
- c.should be_kind_of(REXML::CData)
- c.should be_kind_of(REXML::Text)
- end
+ruby_version_is ''...'2.8' do
+ require 'rexml/document'
- it "respects whitespace if whitespace is true" do
- c = REXML::CData.new("whitespace test", true)
- c1 = REXML::CData.new("whitespace test", false)
+ describe "REXML::CData#initialize" do
+ it "creates a new CData object" do
+ c = REXML::CData.new("some text")
+ c.should be_kind_of(REXML::CData)
+ c.should be_kind_of(REXML::Text)
+ end
- c.to_s.should == "whitespace test"
- c1.to_s.should == "whitespace test"
- end
+ it "respects whitespace if whitespace is true" do
+ c = REXML::CData.new("whitespace test", true)
+ c1 = REXML::CData.new("whitespace test", false)
+
+ c.to_s.should == "whitespace test"
+ c1.to_s.should == "whitespace test"
+ end
- it "receives parent as third argument" do
- e = REXML::Element.new("root")
- REXML::CData.new("test", true, e)
- e.to_s.should == "<root><![CDATA[test]]></root>"
+ it "receives parent as third argument" do
+ e = REXML::Element.new("root")
+ REXML::CData.new("test", true, e)
+ e.to_s.should == "<root><![CDATA[test]]></root>"
+ end
end
end