1. Fabrice Gabolde
  2. Test-SetupTeardown

Commits

Fabrice Gabolde  committed e607561

Use Test::Builder instead of Test::More directly.

Later on this may prove useful.

  • Participants
  • Parent commits af6b5a1
  • Branches default

Comments (0)

Files changed (2)

File Build.PL

View file
  • Ignore whitespace
     },
     requires => {
         'perl' => 5.006,
-        'Test::More' => 0,
+        'Test::Builder' => 0,
     },
     add_to_cleanup      => [ 'Test-SetupTeardown-*' ],
     meta_merge          => { resources =>

File lib/Test/SetupTeardown.pm

View file
  • Ignore whitespace
 use strict;
 use warnings;
 
-use Test::More;
+use Test::Builder;
 
 our $VERSION = 0.001;
 
     my $class = shift;
     my %routines = @_;
 
-    my $self = { setup => $routines{setup},
+    my $self = { tbuilder => Test::Builder->new,
+                 setup => $routines{setup},
                  teardown => $routines{teardown} };
 
     bless $self, $class;
     my ($self, $description, $coderef) = @_;
     my $exception_while_running_block;
 
-    note $description;
+    $self->{tbuilder}->note($description);
 
     # Run setup() routine before each test
     $self->{setup}->() if $self->{setup};
 far (although it might become one).
 
 The description is displayed before the test results with
-L<Test::More>'s C<note()> function.
+L<Test::Builder>'s C<note()> method.
 
 =head1 BUGS AND LIMITATIONS
 
 tests have failed or an exception has been thrown.  Trying to
 determine if tests have failed is probably going to be rather hard
 since at no point L<Test::SetupTeardown> is aware of what tests
-actually B<are>.  (It doesn't use any C<Test::> module itself, except
-L<Test::More> to display the subtest description.)
+actually B<are>.
 
 =item * Provide named callbacks instead of a single C<teardown> (and,
 why not, C<setup>, except I don't really see what you'd use them for).