Skip to content

Commit

Permalink
doc: update tests and README to reflect libxml2 min req (#3304)
Browse files Browse the repository at this point in the history
**What problem is this PR intended to solve?**

This should have been in 3bd6202
  • Loading branch information
flavorjones authored Aug 7, 2024
2 parents fda0346 + e57e4b9 commit 33208e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ Requirements:
- Ruby >= 3.0
- JRuby >= 9.4.0.0

If you are compiling the native extension against a system version of libxml2:

- libxml2 >= 2.9.2 (recommended >= 2.12.0)


### Native Gems: Faster, more reliable installation

Expand Down
3 changes: 0 additions & 3 deletions test/html4/test_document_fragment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ def test_fragment_with_comment
end

def test_element_children_counts
if Nokogiri.uses_libxml?("<= 2.9.1")
skip("#elements doesn't work in 2.9.1, see 1793a5a for history")
end
doc = Nokogiri::HTML4::DocumentFragment.parse(" <div> </div>\n ")
assert_equal(1, doc.element_children.count)
end
Expand Down
7 changes: 3 additions & 4 deletions test/xml/test_entity_reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,14 @@ def setup
xml = File.read(xml_document)
reader = Nokogiri::XML::Reader(xml, path, &:default_xml)

if Nokogiri.uses_libxml?(">= 2.9.0")
# Unknown entity is not fatal in libxml2 >= 2.9
assert_equal 8, reader.count
if Nokogiri.uses_libxml?
assert_equal(8, reader.count)
else
assert_raises(Nokogiri::XML::SyntaxError) do
reader.count
end
end
assert_operator reader.errors.size, :>, 0
assert_operator(reader.errors.size, :>, 0)
end
end
end
Expand Down

0 comments on commit 33208e3

Please sign in to comment.