Module: Nokogiri::Test

Defined in:
ext/nokogiri/test_global_handlers.c,
ext/nokogiri/test_global_handlers.c

Overview

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

Class Method Summary collapse

Class Method Details

.__foreign_error_handler { ... } ⇒ nil

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.

Yields:

Returns:

  • (nil)


21
22
23
24
25
26
27
28
# File 'ext/nokogiri/test_global_handlers.c', line 21

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;
}