10 *CORE::GLOBAL::exit = *CORE::GLOBAL::exit = sub {
12 if ($caller eq 'Test::Leaner') {
19 delete $ENV{PERL_TEST_LEANER_USES_TEST_MORE};
25 use Test::Leaner::TestHelper;
28 capture_to_buffer $buf
29 or plan skip_all => 'perl 5.8 required to test BAIL_OUT()';
36 eval { Test::Leaner::BAIL_OUT() };
37 is $@, '', 'BAIL_OUT() does not croak';
38 is $buf, "Bail out!\n", 'BAIL_OUT() produces the correct TAP code';
39 is $status, 255, 'BAIL_OUT() exits with the correct status';
44 eval { Test::Leaner::BAIL_OUT('this is a comment') };
45 is $@, '', 'BAIL_OUT("comment") does not croak';
46 is $buf, "Bail out! this is a comment\n",
47 'BAIL_OUT("comment") produces the correct TAP code';
48 is $status, 255, 'BAIL_OUT("comment") exits with the correct status';