Sha256: ca8f82003effd3448cb0e1850be9edd093feed35beecde3b8b0a3f919b597f62

Contents?: true

Size: 1.06 KB

Versions: 77

Compression:

Stored size: 1.06 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
            ParserContext.new StringIO.new('fo'), 'UTF-8'
          end
        end

        def test_from_string
          assert_nothing_raised do
            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

77 entries across 77 versions & 11 rubygems

Version Path
nokogiri-maglev--1.5.2 test/html/sax/test_parser_context.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
horseman-0.0.5 vendor/ruby/1.9.1/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/nokogiri-1.5.2/test/html/sax/test_parser_context.rb
nokogiri-1.5.3.rc2-java test/html/sax/test_parser_context.rb
nokogiri-1.5.3.rc2-x86-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.5.3.rc2-x86-mswin32-60 test/html/sax/test_parser_context.rb
nokogiri-1.5.3.rc2 test/html/sax/test_parser_context.rb
nokogiri-1.5.2 test/html/sax/test_parser_context.rb
nokogiri-1.5.2-x86-mswin32-60 test/html/sax/test_parser_context.rb
nokogiri-1.5.2-x86-mingw32 test/html/sax/test_parser_context.rb
nokogiri-1.5.2-java test/html/sax/test_parser_context.rb