X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F12-fail.t;h=21daa75bb08487ab457a9bb413af3848ef3ed114;hb=08ffaabdbd5cc7a4a26c331dc371dd7d49ab1a3a;hp=3278a429c2592504380ef978485faea0f5226f48;hpb=5f6f355aa44893d44ee0050aebcba39a86aff49a;p=catagits%2FTest-NoTabs.git diff --git a/t/12-fail.t b/t/12-fail.t index 3278a42..21daa75 100644 --- a/t/12-fail.t +++ b/t/12-fail.t @@ -2,40 +2,38 @@ use strict; use Test::More qw(no_plan); -use Test::Group; - use File::Temp qw( tempdir tempfile ); my $perl = $^X || 'perl'; my $inc = join(' -I ', @INC) || ''; $inc = "-I $inc" if $inc; -test 'bad file 1' => sub { +{ my $dir = make_bad_file_1(); my ($fh, $outfile) = tempfile(); ok( `$perl $inc -MTest::NoTabs -e "all_perl_files_ok( '$dir' )" 2>&1 > $outfile` ); local $/ = undef; my $content = <$fh>; - like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 4/m, 'tabs found in tmp file' ); -}; + like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 4/m, 'tabs found in tmp file 1' ); +} -test 'bad file 2' => sub { +{ my $dir = make_bad_file_2(); my ($fh, $outfile) = tempfile(); ok( `$perl $inc -MTest::NoTabs -e "all_perl_files_ok( '$dir' )" 2>&1 > $outfile` ); local $/ = undef; my $content = <$fh>; - like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 12/m, 'tabs found in tmp file' ); -}; + like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 12/m, 'tabs found in tmp file2 ' ); +} -test 'bad file 3' => sub { +{ my $file = make_bad_file_3(); my ($fh, $outfile) = tempfile(); ok( `$perl $inc -MTest::NoTabs -e "all_perl_files_ok( '$file' )" 2>&1 > $outfile` ); local $/ = undef; my $content = <$fh>; - like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 6/m, 'tabs found in tmp file' ); -}; + like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 6/m, 'tabs found in tmp file 3' ); +} sub make_bad_file_1 { my $tmpdir = tempdir();