Permalink
Browse files

got rid of END block magick

  • Loading branch information...
1 parent 24a0556 commit cb25b0224cc1b07e6066e310126dad4dea950395 Xavier Caron committed Mar 27, 2012
Showing with 9 additions and 21 deletions.
  1. +1 −1 Makefile.PL
  2. +2 −14 lib/Devel/Cover/Test.pm
  3. +1 −1 tests/change.t
  4. +2 −2 tests/eval_sub.t
  5. +2 −2 tests/eval_use.t
  6. +1 −1 tests/md5.t
View
@@ -124,7 +124,7 @@ use lib "$base/t";
use Devel::Cover::Test;
-Devel::Cover::Test->new("$t");
+Devel::Cover::Test->new("$t")->run_test;
EOT
close T or die "Cannot close t/e2e/a$t.t: $!";
}
View
@@ -19,8 +19,6 @@ use Test;
use Devel::Cover::Inc;
-my $Test;
-
=head1 NAME
Devel::Cover::Test - Internal module for testing
@@ -57,7 +55,7 @@ sub new
eval "use Test::Differences";
my $differences = $INC{"Test/Differences.pm"};
- my $self =
+ my $self = bless
{
test => $test,
criteria => [ $criteria ],
@@ -72,9 +70,7 @@ sub new
differences => $differences,
no_coverage => $ENV{DEVEL_COVER_NO_COVERAGE} || 0,
%params
- };
-
- $Test = bless $self, $class;
+ }, $class;
$self->get_params
}
@@ -127,8 +123,6 @@ sub get_params
$self
}
-sub test { $Test }
-
=head2 shell_quote
my $quoted_item = shell_quote($item)
@@ -516,12 +510,6 @@ sub create_gold
$self->{end}->() if $self->{end};
}
-END
-{
- my $self = $Test;
- $self->run_test if $self->{run_test_at_end};
-}
-
1
__END__
View
@@ -60,4 +60,4 @@ my $test = Devel::Cover::Test->new
run_test => $run_test,
end => sub { unlink $ft },
no_report => 0,
-);
+)->run_test;
View
@@ -39,11 +39,11 @@ my $run_test = sub
my $runs = 4;
-$Devel::Cover::Test::test = Devel::Cover::Test->new
+Devel::Cover::Test->new
(
"eval3",
golden_test => "eval_sub.t",
run_test => $run_test,
changes => [ 'if (/^Run: /) { $get_line->() for 1 .. 5; redo }' ],
tests => sub { $_[0] - $runs * 6 }, # number of lines deleted above
-);
+)->run_test;
View
@@ -36,11 +36,11 @@ my $run_test = sub
$test->run_command($test->test_command);
};
-$Devel::Cover::Test::test = Devel::Cover::Test->new
+Devel::Cover::Test->new
(
"eval2",
golden_test => "eval_use.t",
run_test => $run_test,
changes => [ 'if (/^Run: /) { $get_line->() for 1 .. 5; redo }' ],
tests => sub { $_[0] - 24 }, # number of lines deleted above
-);
+)->run_test;
View
@@ -52,4 +52,4 @@ my $test = Devel::Cover::Test->new
$t,
run_test => $run_test,
end => sub { unlink $ft },
-);
+)->run_test;

0 comments on commit cb25b02

Please sign in to comment.