sync a bunch of files with Test::Simple 0.86
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / Builder / create.t
1 #!/usr/bin/perl -w
2 # $Id$
3
4 #!perl -w
5
6 BEGIN {
7     if( $ENV{PERL_CORE} ) {
8         chdir 't';
9         @INC = ('../lib', 'lib');
10     }
11     else {
12         unshift @INC, 't/lib';
13     }
14 }
15
16 use Test::More tests => 8;
17 use Test::Builder;
18
19 my $more_tb = Test::More->builder;
20 isa_ok $more_tb, 'Test::Builder';
21
22 is $more_tb, Test::More->builder, 'create does not interfere with ->builder';
23 is $more_tb, Test::Builder->new,  '       does not interfere with ->new';
24
25 {
26     my $new_tb  = Test::Builder->create;
27
28     isa_ok $new_tb,  'Test::Builder';
29     isnt $more_tb, $new_tb, 'Test::Builder->create makes a new object';
30
31     $new_tb->output("some_file");
32     END { 1 while unlink "some_file" }
33
34     $new_tb->plan(tests => 1);
35     $new_tb->ok(1);
36 }
37
38 pass("Changing output() of new TB doesn't interfere with singleton");
39
40 ok open FILE, "some_file";
41 is join("", <FILE>), <<OUT;
42 1..1
43 ok 1
44 OUT
45
46 close FILE;