Skip to content

Commit

Permalink
Emulate the existing behavior and pretend the test already started.
Browse files Browse the repository at this point in the history
Doing this mostly for compatibility.

For #242
  • Loading branch information
schwern committed Dec 6, 2011
1 parent ab02fe0 commit 0089158
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 6 additions & 1 deletion lib/Test/Builder/Tester.pm
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,18 @@ sub _start_testing {

# Make a detached TestState
my $state = $original_state->create(
formatters => [$formatter],
formatters => [],

# Preserve existing handlers
early_handlers => $original_state->early_handlers,
late_handlers => $original_state->late_handlers,
);

# To emulate existing behavior, start testing but don't
# let the formatter see it
$state->post_event( TB2::Event::TestStart->new );
$state->add_formatters($formatter);

# remember that we're testing
$testing = 1;

Expand Down
5 changes: 2 additions & 3 deletions t/Tester/change_formatter.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use Test::More;
note "change_formatter_class"; {
change_formatter_class("TB2::Formatter::TAP");

test_out("TAP version 13");
test_out("1..2");
plan tests => 2;
test_out("ok 1");
ok(1, "");
test_test("using the new formatter");
}

0 comments on commit 0089158

Please sign in to comment.