diff options
author | Hiroshi SHIBATA <[email protected]> | 2020-01-12 08:14:26 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <[email protected]> | 2020-01-12 12:28:29 +0900 |
commit | e61cab3a367c4040a2a487dd893c7be9a37889a9 (patch) | |
tree | c6ea3e3c929fcb5fd17197abea387173912f624b /spec/ruby/library/rexml/element/text_spec.rb | |
parent | 83240f315a10b42b53c3b62c1fbc428f97912665 (diff) |
Ignore rexml examples on ruby/spec
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2832
Diffstat (limited to 'spec/ruby/library/rexml/element/text_spec.rb')
-rw-r--r-- | spec/ruby/library/rexml/element/text_spec.rb | 87 |
1 files changed, 45 insertions, 42 deletions
diff --git a/spec/ruby/library/rexml/element/text_spec.rb b/spec/ruby/library/rexml/element/text_spec.rb index 7c290c4cda..b7d493589e 100644 --- a/spec/ruby/library/rexml/element/text_spec.rb +++ b/spec/ruby/library/rexml/element/text_spec.rb @@ -1,46 +1,49 @@ -require 'rexml/document' require_relative '../../../spec_helper' -describe "REXML::Element#text" do - before :each do - @e = REXML::Element.new "name" - @e.text = "John" - end - - it "returns the text node of element" do - @e.text.should == "John" - end - - it "returns the text node value" do - t = REXML::Text.new "Joe" - @e.text = t - @e.text.should == "Joe" - @e.text.should_not == t - end - - it "returns nil if no text is attached" do - elem = REXML::Element.new "name" - elem.text.should == nil - end -end - -describe "REXML::Element#text=" do - before :each do - @e = REXML::Element.new "name" - @e.text = "John" - end - - it "sets the text node" do - @e.to_s.should == "<name>John</name>" - end - - it "replaces existing text" do - @e.text = "Joe" - @e.to_s.should == "<name>Joe</name>" - end - - it "receives nil as an argument" do - @e.text = nil - @e.to_s.should == "<name/>" +ruby_version_is ''...'2.8' do + require 'rexml/document' + + describe "REXML::Element#text" do + before :each do + @e = REXML::Element.new "name" + @e.text = "John" + end + + it "returns the text node of element" do + @e.text.should == "John" + end + + it "returns the text node value" do + t = REXML::Text.new "Joe" + @e.text = t + @e.text.should == "Joe" + @e.text.should_not == t + end + + it "returns nil if no text is attached" do + elem = REXML::Element.new "name" + elem.text.should == nil + end + end + + describe "REXML::Element#text=" do + before :each do + @e = REXML::Element.new "name" + @e.text = "John" + end + + it "sets the text node" do + @e.to_s.should == "<name>John</name>" + end + + it "replaces existing text" do + @e.text = "Joe" + @e.to_s.should == "<name>Joe</name>" + end + + it "receives nil as an argument" do + @e.text = nil + @e.to_s.should == "<name/>" + end end end |