Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

got rid of END block magick

  • Loading branch information...
commit cb25b0224cc1b07e6066e310126dad4dea950395 1 parent 24a0556
authored March 27, 2012
2  Makefile.PL
@@ -124,7 +124,7 @@ use lib "$base/t";
124 124
 
125 125
 use Devel::Cover::Test;
126 126
 
127  
-Devel::Cover::Test->new("$t");
  127
+Devel::Cover::Test->new("$t")->run_test;
128 128
 EOT
129 129
     close T or die "Cannot close t/e2e/a$t.t: $!";
130 130
 }
16  lib/Devel/Cover/Test.pm
@@ -19,8 +19,6 @@ use Test;
19 19
 
20 20
 use Devel::Cover::Inc;
21 21
 
22  
-my $Test;
23  
-
24 22
 =head1 NAME
25 23
 
26 24
 Devel::Cover::Test - Internal module for testing
@@ -57,7 +55,7 @@ sub new
57 55
     eval "use Test::Differences";
58 56
     my $differences = $INC{"Test/Differences.pm"};
59 57
     
60  
-    my $self =
  58
+    my $self = bless
61 59
     {
62 60
         test             => $test,
63 61
         criteria         => [ $criteria ],
@@ -72,9 +70,7 @@ sub new
72 70
         differences      => $differences,
73 71
         no_coverage      => $ENV{DEVEL_COVER_NO_COVERAGE} || 0,
74 72
         %params
75  
-    };
76  
-
77  
-    $Test = bless $self, $class;
  73
+    }, $class;
78 74
 
79 75
     $self->get_params
80 76
 }
@@ -127,8 +123,6 @@ sub get_params
127 123
     $self
128 124
 }
129 125
 
130  
-sub test { $Test }
131  
-
132 126
 =head2 shell_quote
133 127
 
134 128
   my $quoted_item = shell_quote($item)
@@ -516,12 +510,6 @@ sub create_gold
516 510
     $self->{end}->() if $self->{end};
517 511
 }
518 512
 
519  
-END
520  
-{
521  
-    my $self = $Test;
522  
-    $self->run_test if $self->{run_test_at_end};
523  
-}
524  
-
525 513
 1
526 514
 
527 515
 __END__
2  tests/change.t
@@ -60,4 +60,4 @@ my $test = Devel::Cover::Test->new
60 60
     run_test => $run_test,
61 61
     end      => sub { unlink $ft },
62 62
     no_report => 0,
63  
-);
  63
+)->run_test;
4  tests/eval_sub.t
@@ -39,11 +39,11 @@ my $run_test = sub
39 39
 
40 40
 my $runs = 4;
41 41
 
42  
-$Devel::Cover::Test::test = Devel::Cover::Test->new
  42
+Devel::Cover::Test->new
43 43
 (
44 44
     "eval3",
45 45
     golden_test => "eval_sub.t",
46 46
     run_test    => $run_test,
47 47
     changes     => [ 'if (/^Run: /) { $get_line->() for 1 .. 5; redo }' ],
48 48
     tests       => sub { $_[0] - $runs * 6 },  # number of lines deleted above
49  
-);
  49
+)->run_test;
4  tests/eval_use.t
@@ -36,11 +36,11 @@ my $run_test = sub
36 36
     $test->run_command($test->test_command);
37 37
 };
38 38
 
39  
-$Devel::Cover::Test::test = Devel::Cover::Test->new
  39
+Devel::Cover::Test->new
40 40
 (
41 41
     "eval2",
42 42
     golden_test => "eval_use.t",
43 43
     run_test    => $run_test,
44 44
     changes     => [ 'if (/^Run: /) { $get_line->() for 1 .. 5; redo }' ],
45 45
     tests       => sub { $_[0] - 24 },  # number of lines deleted above
46  
-);
  46
+)->run_test;
2  tests/md5.t
@@ -52,4 +52,4 @@ my $test = Devel::Cover::Test->new
52 52
     $t,
53 53
     run_test => $run_test,
54 54
     end      => sub { unlink $ft },
55  
-);
  55
+)->run_test;

0 notes on commit cb25b02

Please sign in to comment.
Something went wrong with that request. Please try again.