Sha256: 7996019ddc57808f3bda0c33b1f6ddd0ecd59ce1852fbc207c5716eba236a25d

Contents?: true

Size: 1.07 KB

Versions: 23

Compression:

Stored size: 1.07 KB

Contents

# -*- coding: utf-8 -*-

require "helper"

module Nokogiri
  module HTML
    module SAX
      class TestParserContext < Nokogiri::SAX::TestCase
        def test_from_io
          assert_nothing_raised do
            ctx = ParserContext.new StringIO.new('fo'), 'UTF-8'
          end
        end

        def test_from_string
          assert_nothing_raised do
            ctx = ParserContext.new 'blah blah'
          end
        end

        def test_parse_with
          ctx = ParserContext.new 'blah'
          assert_raises ArgumentError do
            ctx.parse_with nil
          end
        end

        def test_parse_with_sax_parser
          assert_nothing_raised do
            xml = "<root />"
            ctx = ParserContext.new xml
            parser = Parser.new Doc.new
            ctx.parse_with parser
          end
        end

        def test_from_file
          assert_nothing_raised do
            ctx = ParserContext.file HTML_FILE, 'UTF-8'
            parser = Parser.new Doc.new
            ctx.parse_with parser
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 7 rubygems

Version Path
glebm-nokogiri-1.4.2.1 test/html/sax/test_parser_context.rb
nokogiri-1.5.0.beta.1 test/html/sax/test_parser_context.rb
nokogiri-1.4.2.1-x86-mswin32 test/html/sax/test_parser_context.rb
nokogiri-1.4.2.1-x86-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.5.0.beta.1-java test/html/sax/test_parser_context.rb
nokogiri-1.4.2-java test/html/sax/test_parser_context.rb
nokogiri-1.4.2 test/html/sax/test_parser_context.rb
rubyjedi-nokogiri_java-1.4.0.20100513161003-java test/html/sax/test_parser_context.rb
jwagener-nokogiri-1.4.1 test/html/sax/test_parser_context.rb
revo-nokogiri-1.4.1-java test/html/sax/test_parser_context.rb
revo-nokogiri-1.4.0.3-java test/html/sax/test_parser_context.rb
revo-nokogiri-1.4.0-java test/html/sax/test_parser_context.rb
revo-nokogiri-1.4.0.20100202165440-java test/html/sax/test_parser_context.rb
nokogiri-1.4.1-x86-mswin32 test/html/sax/test_parser_context.rb
nokogiri-1.4.1-x86-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.4.1-java test/html/sax/test_parser_context.rb
nokogiri-1.4.1 test/html/sax/test_parser_context.rb
superfeedr-nokogiri-1.4.0.20091116183308 test/html/sax/test_parser_context.rb
caring-nokogiri-1.4.1.pre1 test/html/sax/test_parser_context.rb
nokogiri-1.4.0-java test/html/sax/test_parser_context.rb