From: Tomas Doran Date: Sat, 8 Sep 2012 20:18:04 +0000 (+0100) Subject: Default to using the cwd to base tests X-Git-Tag: 1.5~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FTest-EOL.git;a=commitdiff_plain;h=856d7baf059e2f87941216e3067dbb1deaa955c3;hp=0ea2c8fa05cc9d6dce1264d6c728e9d4623bfe41 Default to using the cwd to base tests ::Bin .. no longer used, as per RT#66177 --- diff --git a/lib/Test/EOL.pm b/lib/Test/EOL.pm index 82e2be6..3c0ceea 100644 --- a/lib/Test/EOL.pm +++ b/lib/Test/EOL.pm @@ -6,8 +6,8 @@ use warnings; use Test::Builder; use File::Spec; -use FindBin qw($Bin); use File::Find; +use Cwd qw/ cwd /; use vars qw( $PERL $UNTAINT_PATTERN $PERL_PATTERN); @@ -42,7 +42,8 @@ sub _all_perl_files { } sub _all_files { - my @base_dirs = @_ ? @_ : File::Spec->catdir($Bin, $updir); + my @base_dirs = @_ ? @_ : cwd(); + my $options = pop(@base_dirs) if ref $base_dirs[-1] eq 'HASH'; my @found; my $want_sub = sub { return if ($File::Find::dir =~ m![\\/]?CVS[\\/]|[\\/]?\.svn[\\/]!); # Filter out cvs or subversion dirs/ diff --git a/t/10-use-self.t b/t/10-use-self.t index f9f757b..3e53f29 100644 --- a/t/10-use-self.t +++ b/t/10-use-self.t @@ -1,3 +1,6 @@ # Check that our own source is clean use Test::EOL; -all_perl_files_ok({ trailing_whitespace => 1 }); +use Cwd; +use File::Spec; +all_perl_files_ok(File::Spec->catdir(cwd(), 'lib'), { trailing_whitespace => 1 }); +