Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

drop funcs.pm in favor of TAP::SimpleOutput

Same code, fewer places to mess it up :)
  • Loading branch information...
commit ac0332cd7de303365291035b29d09841af51fa4b 1 parent 142bcd8
Chris Weyl authored October 02, 2012
2  t/does_not_ok.t
@@ -14,7 +14,7 @@ use Test::Builder::Tester;
14 14
 use Test::More;
15 15
 use Test::Moose::More;
16 16
 
17  
-require 't/funcs.pm' unless eval { require funcs };
  17
+use TAP::SimpleOutput 'counters';
18 18
 
19 19
 my $ROLE  = 'TestRole::Role';
20 20
 my @ROLES = qw{ TestRole::Role TestRole::Role2 };
2  t/does_ok.t
@@ -17,7 +17,7 @@ use Test::Builder::Tester;
17 17
 use Test::More;
18 18
 use Test::Moose::More;
19 19
 
20  
-require 't/funcs.pm' unless eval { require funcs };
  20
+use TAP::SimpleOutput 'counters';
21 21
 
22 22
 my $ROLE  = 'TestRole::Role';
23 23
 my @ROLES = qw{ TestRole::Role TestRole::Role2 };
20  t/funcs.pm
... ...
@@ -1,20 +0,0 @@
1  
-
2  
-# use as:
3  
-my ($_ok, $_nok, $_skip) = counters();
4  
-
5  
-sub counters {
6  
-    my $level = shift @_ || 0;
7  
-    $level *= 4;
8  
-    my $i = 0;
9  
-
10  
-    my $indent = !$level ? q{} : (' ' x $level);
11  
-
12  
-    return (
13  
-        sub { $indent .     'ok ' . ++$i . " - $_[0]"      },
14  
-        sub { $indent . 'not ok ' . ++$i . " - $_[0]"      },
15  
-        sub { $indent .     'ok ' . ++$i . " # skip $_[0]" },
16  
-        sub { $indent . "1..$i"                            },
17  
-    );
18  
-}
19  
-
20  
-!!42;
2  t/has_attribute_ok.t
@@ -12,7 +12,7 @@ use Test::More;
12 12
 use Test::Moose::More;
13 13
 use Scalar::Util 'blessed';
14 14
 
15  
-require 't/funcs.pm' unless eval { require funcs };
  15
+use TAP::SimpleOutput 'counters';
16 16
 
17 17
 my @THINGS = (TestClass->new(), qw{ TestClass TestRole });
18 18
 my @FAILS  = (qw{ TestClass::Fail TestRole::Fail });
2  t/meta_ok.t
@@ -18,7 +18,7 @@ use Test::Builder::Tester; # tests => 1;
18 18
 use Test::More;
19 19
 use Test::Moose::More;
20 20
 
21  
-require 't/funcs.pm' unless eval { require funcs };
  21
+use TAP::SimpleOutput 'counters';
22 22
 
23 23
 my $ROLE = 'TestRole::Role';
24 24
 
2  t/validate_class.t
@@ -38,7 +38,7 @@ use Test::Builder::Tester; # tests => 1;
38 38
 use Test::More;
39 39
 use Test::Moose::More;
40 40
 
41  
-require 't/funcs.pm' unless eval { require funcs };
  41
+use TAP::SimpleOutput 'counters';
42 42
 
43 43
 note 'validate w/valid class';
44 44
 {
2  t/validate_role.t
@@ -40,7 +40,7 @@ use Test::Builder::Tester; # tests => 1;
40 40
 use Test::More;
41 41
 use Test::Moose::More;
42 42
 
43  
-require 't/funcs.pm' unless eval { require funcs };
  43
+use TAP::SimpleOutput 'counters';
44 44
 
45 45
 note 'validate w/valid role';
46 46
 {

0 notes on commit ac0332c

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