This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Test-Simple-0.94
[perl5.git] / cpan / Test-Simple / t / Builder / create.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = ('../lib', 'lib');
7     }
8     else {
9         unshift @INC, 't/lib';
10     }
11 }
12
13 use Test::More tests => 7;
14 use Test::Builder;
15 use Test::Builder::NoOutput;
16
17 my $more_tb = Test::More->builder;
18 isa_ok $more_tb, 'Test::Builder';
19
20 is $more_tb, Test::More->builder, 'create does not interfere with ->builder';
21 is $more_tb, Test::Builder->new,  '       does not interfere with ->new';
22
23 {
24     my $new_tb = Test::Builder::NoOutput->create;
25
26     isa_ok $new_tb,  'Test::Builder';
27     isnt $more_tb, $new_tb, 'Test::Builder->create makes a new object';
28
29     $new_tb->plan(tests => 1);
30     $new_tb->ok(1, "a test");
31
32     is $new_tb->read, <<'OUT';
33 1..1
34 ok 1 - a test
35 OUT
36 }
37
38 pass("Changing output() of new TB doesn't interfere with singleton");