123456789_123456789_123456789_123456789_123456789_

Module: Nokogiri::Test

Relationships & Source Files
Defined in: ext/nokogiri/test_global_handlers.c

Overview

The Test module should only be used for testing ::Nokogiri. Do NOT use this outside of the ::Nokogiri test suite.

Class Method Summary

Class Method Details

.__foreign_error_handlernil

Override libxml2’s global error handlers to call the block. This method thus has very little value except to test that ::Nokogiri is properly setting error handlers elsewhere in the code. See test/helper.rb for how this is being used.

[ GitHub ]

  
# File 'ext/nokogiri/test_global_handlers.c', line 19

static VALUE
rb_foreign_error_handler(VALUE klass)
{
  rb_need_block();
  foreign_error_handler_block = rb_block_proc();
  xmlSetStructuredErrorFunc(NULL, foreign_error_handler);
  return Qnil;
}