10 *CORE::GLOBAL::exit = *CORE::GLOBAL::exit = sub {
12 if ($caller eq 'Test::Leaner') {
23 use Test::Leaner::TestHelper;
26 capture_to_buffer $buf
27 or plan skip_all => 'perl 5.8 required to test BAIL_OUT()';
34 eval { Test::Leaner::BAIL_OUT() };
35 is $@, '', 'BAIL_OUT() does not croak';
36 is $buf, "Bail out!\n", 'BAIL_OUT() produces the correct TAP code';
37 is $status, 255, 'BAIL_OUT() exits with the correct status';
42 eval { Test::Leaner::BAIL_OUT('this is a comment') };
43 is $@, '', 'BAIL_OUT("comment") does not croak';
44 is $buf, "Bail out! this is a comment\n",
45 'BAIL_OUT("comment") produces the correct TAP code';
46 is $status, 255, 'BAIL_OUT("comment") exits with the correct status';