Sha256: 98a180dfff962dde0b2300e586dd7b68760066d8d9302517f47a6f6c8e023e9c

Contents?: true

Size: 1.02 KB

Versions: 346

Compression:

Stored size: 1.02 KB

Contents

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

require "helper"

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

        def test_from_string
          ctx = ParserContext.new 'blah blah'
          assert ctx
        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

346 entries across 336 versions & 27 rubygems

Version Path
tdiary-5.0.11 vendor/bundle/gems/nokogiri-1.8.4/test/html/sax/test_parser_context.rb
tdiary-5.0.11 vendor/bundle/gems/nokogiri-1.8.5/test/html/sax/test_parser_context.rb
nokogiri-1.9.0.rc1 test/html/sax/test_parser_context.rb
nokogiri-1.9.0.rc1-x86-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.9.0.rc1-x64-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.9.0.rc1-java test/html/sax/test_parser_context.rb
nokogiri-1.8.5 test/html/sax/test_parser_context.rb
nokogiri-1.8.5-x86-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.8.5-x64-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.8.5-java test/html/sax/test_parser_context.rb
daslabs-0.12.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/html/sax/test_parser_context.rb
daslabs-0.11.0 vendor/cache/ruby/2.5.0/gems/nokogiri-1.8.2/test/html/sax/test_parser_context.rb
nokogiri-1.8.4 test/html/sax/test_parser_context.rb
nokogiri-1.8.4-x86-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.8.4-x64-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.8.4-java test/html/sax/test_parser_context.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/nokogiri-1.8.3/test/html/sax/test_parser_context.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/nokogiri-1.8.3/test/html/sax/test_parser_context.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.3/test/html/sax/test_parser_context.rb
tdiary-5.0.9 vendor/bundle/gems/nokogiri-1.8.2/test/html/sax/test_parser_context.rb