From: Jesse Luehrs Date: Thu, 4 Jul 2013 16:10:02 +0000 (-0400) Subject: stop using use_ok, it's pointless X-Git-Tag: Try-Tiny-0.13~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=01b962750a5bd5207e609310dfc92fb20e4e807c;p=p5sagit%2FTry-Tiny.git stop using use_ok, it's pointless --- diff --git a/t/basic.t b/t/basic.t index 7552721..b3e2cab 100644 --- a/t/basic.t +++ b/t/basic.t @@ -5,7 +5,7 @@ use warnings; use Test::More tests => 26; -BEGIN { use_ok 'Try::Tiny' }; +use Try::Tiny; sub _eval { local $@; diff --git a/t/context.t b/t/context.t index e25a09c..1a57ba0 100644 --- a/t/context.t +++ b/t/context.t @@ -3,17 +3,14 @@ use warnings; use Test::More; -BEGIN { - plan tests => - 1 # use_ok - + (4+1) * 2 # list/scalar with exception (try + catch + 2 x finally) + is_deeply - + 4 # void with exception - + (3+1) * 2 # list/scalar no exception (try + 2 x finally) + is_deeply - + 3 # void no exception - ; +use Try::Tiny; - use_ok 'Try::Tiny'; -} +plan tests => + (4+1) * 2 # list/scalar with exception (try + catch + 2 x finally) + is_deeply ++ 4 # void with exception ++ (3+1) * 2 # list/scalar no exception (try + 2 x finally) + is_deeply ++ 3 # void no exception +; my $ctx_index = { VOID => undef, diff --git a/t/erroneous_usage.t b/t/erroneous_usage.t index b64da61..789cd68 100644 --- a/t/erroneous_usage.t +++ b/t/erroneous_usage.t @@ -4,6 +4,7 @@ use strict; use warnings; use Test::More tests => 6; + use Try::Tiny; sub _eval { diff --git a/t/finally.t b/t/finally.t index 1c969de..228d23f 100644 --- a/t/finally.t +++ b/t/finally.t @@ -5,7 +5,7 @@ use warnings; use Test::More tests => 28; -BEGIN { use_ok 'Try::Tiny' }; +use Try::Tiny; try { my $a = 1+1; diff --git a/t/given_when.t b/t/given_when.t index edd8a4e..0b612ae 100644 --- a/t/given_when.t +++ b/t/given_when.t @@ -8,9 +8,10 @@ use Test::More; BEGIN { plan skip_all => "Perl 5.10 is required" unless eval { require 5.010 }; plan tests => 3; - use_ok("Try::Tiny"); } +use Try::Tiny; + use 5.010; no if $] >= 5.017011, warnings => 'experimental::smartmatch'; diff --git a/t/when.t b/t/when.t index d67fe95..23a3ef7 100644 --- a/t/when.t +++ b/t/when.t @@ -10,8 +10,7 @@ BEGIN { plan tests => 6; } - -BEGIN { use_ok 'Try::Tiny' } +use Try::Tiny; use 5.010; no if $] >= 5.017011, warnings => 'experimental::smartmatch';