Permalink
Browse files

Removed dependency on Sub::Install. Prevent the tests to dies if Kwal…

…itee and Perl::Critic are not found
  • Loading branch information...
rija committed Jun 10, 2008
1 parent c9b84ab commit 3bea737722069c3db64ddded588c73ef211ec56f
Showing with 16 additions and 18 deletions.
  1. +4 −13 t/01.behaviours.t
  2. +5 −3 t/kwalitee.t
  3. +7 −2 t/perlcritic.t
@@ -1,8 +1,8 @@
#!perl -w

use strict;
use lib '..';
use Test::More::Behaviours 'no_plan';
use Test::Exception;
use Sub::Install;

use constant TRUE => 1;
use constant FALSE => 0;
@@ -15,17 +15,8 @@ BEGIN {
} ;
}

Sub::Install::install_sub {
code => sub { $is_setup = TRUE;},
into => 'main',
as => 'set_up'
};

Sub::Install::install_sub {
code => sub { $is_setup = FALSE;},
into => 'main',
as => 'tear_down'
};
*main::set_up = sub { $is_setup = TRUE } ;
*main::tear_down = sub { $is_setup = FALSE } ;

test 'setup test' => sub {
ok( $is_setup, 'should have been setup' );
@@ -1,7 +1,9 @@
# in a separate test file
#!perl -w

use strict;
use Test::More;

eval { require Test::Kwalitee; Test::Kwalitee->import() };
eval { require Test::Kwalitee; };

warn $@ if $@ ;
plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@;
Test::Kwalitee->import() ;
@@ -1,6 +1,11 @@
#!perl
#!perl -w

if (!require Test::Perl::Critic) {
use strict;
use Test::More ;

eval{ require Test::Perl::Critic ; } ;

if ($@) {
Test::More::plan(
skip_all => "Test::Perl::Critic required for testing PBP compliance"
);

0 comments on commit 3bea737

Please sign in to comment.