Skip to content

Commit

Permalink
test: move the test from 3c95d44 to be within a test class
Browse files Browse the repository at this point in the history
I don't think this test ever actually ran.
  • Loading branch information
flavorjones committed Aug 18, 2021
1 parent 3e10984 commit 5840d84
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions test/html4/test_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,21 +187,19 @@ def test_to_html_does_not_contain_entities
nokogiri.at("p").to_html.gsub(/ /, '')
end
end
end

def test_GH_1042
file = File.join(ASSETS_DIR, 'GH_1042.html');
html = Nokogiri::HTML(File.read(file))
table = html.xpath("//table")[1]
trs = table.xpath("tr").drop(1)

# the jruby inplementation of drop uses dup() on the IRubyObject (which
# is NOT the same dup() method on the ruby Object) which produces a
# shallow clone. a shallow of valid XMLNode triggers several
# NullPointerException on inspect() since loads of invariants
# are not set. the fix for GH1042 ensures a proper working clone.
assert_nothing_raised do
trs.inspect
def test_GH_1042
file = File.join(ASSETS_DIR, 'GH_1042.html');
html = Nokogiri::HTML(File.read(file))
table = html.xpath("//table")[1]
trs = table.xpath("tr").drop(1)

# the jruby inplementation of drop uses dup() on the IRubyObject (which
# is NOT the same dup() method on the ruby Object) which produces a
# shallow clone. a shallow of valid XMLNode triggers several
# NullPointerException on inspect() since loads of invariants
# are not set. the fix for GH1042 ensures a proper working clone.
trs.inspect # assert_nothing_raised
end
end
end
Expand Down

0 comments on commit 5840d84

Please sign in to comment.