diff --git a/test/html4/test_document.rb b/test/html4/test_document.rb index 988989f5f10..7e05fc25b68 100644 --- a/test/html4/test_document.rb +++ b/test/html4/test_document.rb @@ -24,6 +24,7 @@ def test_exceptions_remove_newlines refute_empty(errors, "has errors") errors.each do |error| assert_equal(error.to_s.chomp, error.to_s) + assert_nil(error.path) end end @@ -813,6 +814,7 @@ def test_silencing_nonparse_errors_during_attribute_insertion_1262 Nokogiri::HTML4.parse(input, nil, nil, parse_options) end assert_match(/Parser without recover option encountered error or warning/, exception.to_s) + assert_nil(exception.path) end end @@ -835,6 +837,7 @@ def test_silencing_nonparse_errors_during_attribute_insertion_1262 Nokogiri::HTML4.parse(input, nil, "UTF-8", parse_options) end assert_match(/Parser without recover option encountered error or warning/, exception.to_s) + assert_nil(exception.path) end end diff --git a/test/xml/test_document.rb b/test/xml/test_document.rb index 65589d80d3d..2860c99a798 100644 --- a/test/xml/test_document.rb +++ b/test/xml/test_document.rb @@ -1087,9 +1087,10 @@ def test_can_be_closed let(:parse_options) { xml_strict } it "raises exception on parse error" do - assert_raises Nokogiri::SyntaxError do + error = assert_raises Nokogiri::SyntaxError do Nokogiri::XML.parse(input, nil, nil, parse_options) end + assert_nil(error.path) end end