blob: cfdc758acdd91d6bd58fc965ccd9fcb3af06e318 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
require_relative '../../../spec_helper'
ruby_version_is ''...'2.8' do
require 'rexml/document'
describe "REXML::Element#get_text" do
before :each do
@doc = REXML::Document.new "<p>some text<b>this is bold!</b> more text</p>"
end
it "returns the first text child node" do
@doc.root.get_text.value.should == "some text"
@doc.root.get_text.should be_kind_of(REXML::Text)
end
it "returns text from an element matching path" do
@doc.root.get_text("b").value.should == "this is bold!"
@doc.root.get_text("b").should be_kind_of(REXML::Text)
end
end
end
|