Sha256: 696aca9eab6a36a456edcc695f4baf778df481d0dbca22574c9394619ee61cd4

Contents?: true

Size: 828 Bytes

Versions: 16

Compression:

Stored size: 828 Bytes

Contents

require "helper"

module Nokogiri
  module XML
    class TestText < Nokogiri::TestCase
      def test_inspect
        node = Text.new('hello world', Document.new)
        assert_equal "#<#{node.class.name}:#{sprintf("0x%x",node.object_id)} #{node.text.inspect}>", node.inspect
      end

      def test_new
        node = Text.new('hello world', Document.new)
        assert node
        assert_equal('hello world', node.content)
        assert_instance_of Nokogiri::XML::Text, node
      end

      def test_lots_of_text
        100.times { Text.new('hello world', Document.new) }
      end

      # No assertion because this was a segv
      def test_new_without_document
        doc = Document.new
        node = Nokogiri::XML::Element.new('foo', doc)
        text = Text.new('hello world', node)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 6 rubygems

Version Path
rubyjedi-nokogiri_java-1.4.0.20100513161003-java test/xml/test_text.rb
jwagener-nokogiri-1.4.1 test/xml/test_text.rb
revo-nokogiri-1.4.1-java test/xml/test_text.rb
revo-nokogiri-1.4.0.3-java test/xml/test_text.rb
revo-nokogiri-1.4.0-java test/xml/test_text.rb
revo-nokogiri-1.4.0.20100202165440-java test/xml/test_text.rb
nokogiri-1.4.1-x86-mswin32 test/xml/test_text.rb
nokogiri-1.4.1-x86-mingw32 test/xml/test_text.rb
nokogiri-1.4.1-java test/xml/test_text.rb
nokogiri-1.4.1 test/xml/test_text.rb
superfeedr-nokogiri-1.4.0.20091116183308 test/xml/test_text.rb
caring-nokogiri-1.4.1.pre1 test/xml/test_text.rb
nokogiri-1.4.0-java test/xml/test_text.rb
nokogiri-1.4.0-x86-mswin32 test/xml/test_text.rb
nokogiri-1.4.0-x86-mingw32 test/xml/test_text.rb
nokogiri-1.4.0 test/xml/test_text.rb