") }
describe "strict parsing" do
let(:parse_options) { html_strict }
diff --git a/test/html4/test_document_encoding.rb b/test/html4/test_document_encoding.rb
index 0abc7057818..1cadf151589 100644
--- a/test/html4/test_document_encoding.rb
+++ b/test/html4/test_document_encoding.rb
@@ -148,7 +148,7 @@ def binopen(file)
end
describe "error handling" do
- RAW = "
RAW, "read_io" => StringIO.new(RAW) }.each do |flavor, input|
it "#{flavor} should handle errors" do
diff --git a/test/html4/test_element_description.rb b/test/html4/test_element_description.rb
index bdc8d6ce654..fda891ab532 100644
--- a/test/html4/test_element_description.rb
+++ b/test/html4/test_element_description.rb
@@ -58,7 +58,9 @@ def test_description
def test_subelements
sub_elements = ElementDescription["body"].sub_elements
- if Nokogiri.uses_libxml?
+ if Nokogiri.uses_libxml?(">= 2.14.0")
+ assert_equal(0, sub_elements.length)
+ elsif Nokogiri.uses_libxml?
assert_equal(65, sub_elements.length)
else
assert_equal(105, sub_elements.length)
@@ -66,7 +68,12 @@ def test_subelements
end
def test_default_sub_element
- assert_equal("div", ElementDescription["body"].default_sub_element)
+ sub_element = ElementDescription["body"].default_sub_element
+ if Nokogiri.uses_libxml?(">= 2.14.0")
+ assert_nil(sub_element)
+ else
+ assert_equal("div", sub_element)
+ end
end
def test_null_default_sub_element
@@ -86,7 +93,11 @@ def test_optional_attributes
def test_deprecated_attributes
attrs = ElementDescription["table"].deprecated_attributes
assert(attrs)
- assert_equal(2, attrs.length)
+ if Nokogiri.uses_libxml?(">= 2.14.0")
+ assert_equal(0, attrs.length)
+ else
+ assert_equal(2, attrs.length)
+ end
end
def test_required_attributes
diff --git a/test/html4/test_node.rb b/test/html4/test_node.rb
index 60759b9ceb3..45ee8feb193 100644
--- a/test/html4/test_node.rb
+++ b/test/html4/test_node.rb
@@ -168,13 +168,10 @@ def test_fragment_serialization
end
def test_to_html_does_not_contain_entities
- # as generated by a tool like NKF
html = "\r\n
test paragraph\r\nfoo bar
\r\n\r\n"
nokogiri = Nokogiri::HTML4.parse(html)
- if RUBY_PLATFORM.include?("java")
- # NKF linebreak modes are not supported as of jruby 1.2
- # see http://jira.codehaus.org/browse/JRUBY-3602 for status
+ if Nokogiri.jruby? || Nokogiri.uses_libxml?(">= 2.14.0")
assert_equal(
"
testparagraph\nfoobar
",
nokogiri.at("p").to_html.delete(" "),