Sha256: 2e12b8230cca3d5e867934183871dedd77a40b93822209b4622d55c1b7d66087

Contents?: true

Size: 569 Bytes

Versions: 49

Compression:

Stored size: 569 Bytes

Contents

require 'rexml/document'
require File.expand_path('../../../../spec_helper', __FILE__)

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

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
rhodes-3.2.2 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.2.2.beta spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.2.1 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.2.0 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.2.0.beta.9 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.2.0.beta.8 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.2.0.beta.7 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.2.0.beta.6 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.2.0.beta.5 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb