require "helper"
module Nokogiri
module XSLT
class TestExceptionHandling < Nokogiri::TestCase
def test_java_exception_handling
skip('This test is for Java only') if Nokogiri.uses_libxml?
xml = Nokogiri.XML(<<-EOXML)
EOXML
xsl = Nokogiri.XSLT(<<-EOXSL)
EOXSL
begin
xsl.transform xml
fail('It should not get here')
rescue RuntimeError => e
assert_match(/HIERARCHY_REQUEST_ERR/, e.to_s, 'The exception message does not contain the expected information')
end
end
end
end
end