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-7.6.0 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-7.5.1 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-7.4.1 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-7.1.17 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-6.2.0 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-6.0.11 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-5.5.18 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-5.5.17 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-5.5.15 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-5.5.2 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-5.5.0 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.3.5 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb
rhodes-3.4.2 spec/framework_spec/app/spec/library/rexml/element/get_text_spec.rb