Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Test/Builder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ sub skip {
} unless $self->{no_log_results};

my $tctx = $ctx->snapshot;
$tctx->skip('', $why);
$tctx->skip($name, $why);

return release $ctx, 1;
}
Expand Down
17 changes: 16 additions & 1 deletion t/Legacy/Builder/details.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use Test::More;
use Test::Builder;
my $Test = Test::Builder->new;

$Test->plan( tests => 9 );
$Test->plan( tests => 10 );
$Test->level(0);

my @Expected_Details;
Expand Down Expand Up @@ -46,6 +46,7 @@ push @Expected_Details, { 'ok' => 1,
reason => 'just testing skip',
};


TODO: {
local $TODO = 'i need a todo';
$Test->ok( 0, 'a test to todo!' );
Expand Down Expand Up @@ -93,6 +94,19 @@ $Test->is_num( scalar @details, 6,
$Test->level(1);
is_deeply( \@details, \@Expected_Details );

{
SKIP: {
$Test->skip( 'testing skip with message', 'test message' );
}

push @Expected_Details, {
ok => 1,
actual_ok => 1,
name => 'test message',
type => 'skip',
reason => 'testing skip with message',
};
}

# This test has to come last because it thrashes the test details.
{
Expand All @@ -103,3 +117,4 @@ is_deeply( \@details, \@Expected_Details );
$Test->current_test($curr_test);
$Test->is_num( scalar @details, 4 );
}

Loading