2018-03-04 15:09:32 +00:00
|
|
|
require_relative '../../../spec_helper'
|
2017-05-07 12:04:49 +00:00
|
|
|
|
2020-09-15 21:54:31 +02:00
|
|
|
ruby_version_is ''...'3.0' do
|
2020-01-12 08:14:26 +09:00
|
|
|
require 'rexml/document'
|
2017-05-07 12:04:49 +00:00
|
|
|
|
2020-01-12 08:14:26 +09:00
|
|
|
describe "REXML::Element#comments" do
|
|
|
|
before :each do
|
|
|
|
@e = REXML::Element.new "root"
|
|
|
|
@c1 = REXML::Comment.new "this is a comment"
|
|
|
|
@c2 = REXML::Comment.new "this is another comment"
|
|
|
|
@e << @c1
|
|
|
|
@e << @c2
|
|
|
|
end
|
|
|
|
|
|
|
|
it "returns the array of comments" do
|
|
|
|
@e.comments.should == [@c1, @c2]
|
|
|
|
end
|
2017-05-07 12:04:49 +00:00
|
|
|
|
2020-01-12 08:14:26 +09:00
|
|
|
it "returns a frozen object" do
|
2020-05-03 12:28:29 +02:00
|
|
|
@e.comments.should.frozen?
|
2020-01-12 08:14:26 +09:00
|
|
|
end
|
2017-05-07 12:04:49 +00:00
|
|
|
end
|
|
|
|
end
|