2018-03-04 15:09:32 +00:00
|
|
|
require_relative '../../../spec_helper'
|
2017-05-07 12:04:49 +00:00
|
|
|
|
2020-01-12 08:14:26 +09:00
|
|
|
ruby_version_is ''...'2.8' do
|
|
|
|
require 'rexml/document'
|
2017-05-07 12:04:49 +00:00
|
|
|
|
2020-01-12 08:14:26 +09:00
|
|
|
describe "REXML::Element#has_text?" do
|
|
|
|
|
|
|
|
it "returns true if element has a Text child" do
|
|
|
|
e = REXML::Element.new("Person")
|
|
|
|
e.text = "My text"
|
|
|
|
e.has_text?.should be_true
|
|
|
|
end
|
2017-05-07 12:04:49 +00:00
|
|
|
|
2020-01-12 08:14:26 +09:00
|
|
|
it "returns false if it has no Text childs" do
|
|
|
|
e = REXML::Element.new("Person")
|
|
|
|
e.has_text?.should be_false
|
|
|
|
end
|
2017-05-07 12:04:49 +00:00
|
|
|
end
|
|
|
|
end
|