File: tc_html_parser_context.rb

package info (click to toggle)
ruby-libxml 2.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,024 kB
  • ctags: 2,251
  • sloc: xml: 9,628; ansic: 8,409; ruby: 7,806; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 692 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# encoding: UTF-8

require './test_helper'

require 'test/unit'

class TestHtmlParserContext < Test::Unit::TestCase
  def test_default_options
    XML.default_keep_blanks = true
    context = XML::HTMLParser::Context.new
    assert_equal(0, context.options)
  end

  def test_no_options
    XML.default_keep_blanks = true
    context = XML::HTMLParser::Context.new
    context.options = 0
    assert_equal(0, context.options)
  end

  def test_options
    XML.default_keep_blanks = true
    context = XML::HTMLParser::Context.new
    context.options = XML::HTMLParser::Options::NOERROR
    assert_equal(XML::HTMLParser::Options::NOERROR, context.options)
  end
end