Commit | Line | Data |
---|---|---|
afad11a2 RS |
1 | use strict; |
2 | ||
3 | use Test::Tester; | |
4 | ||
5 | my $Test = Test::Builder->new; | |
6 | $Test->plan(tests => 3); | |
7 | ||
8 | my $cap; | |
9 | ||
10 | $cap = Test::Tester->capture; | |
11 | ||
12 | { | |
13 | no warnings 'redefine'; | |
14 | sub Test::Tester::find_run_tests { return 0}; | |
15 | } | |
16 | ||
17 | local $Test::Builder::Level = 0; | |
18 | { | |
19 | my $cur = $cap->current_test; | |
20 | $Test->is_num($cur, 0, "current test"); | |
21 | ||
22 | eval {$cap->current_test(2)}; | |
23 | $Test->ok($@, "can't set test_num"); | |
24 | } | |
25 | ||
26 | { | |
27 | $cap->ok(1, "a test"); | |
28 | ||
29 | my @res = $cap->details; | |
30 | ||
31 | $Test->is_num(scalar @res, 1, "res count"); | |
32 | } |