Skip to content

Commit

Permalink
Added SKIP block to skip new's tests if there is no terminal accordin…
Browse files Browse the repository at this point in the history
…g to -t.

This fixes some CPAN Testers FAILs due to STDIN not being a proper terminal,
which borks all of the Term::ReadLine->new('fetchware test') calls.
  • Loading branch information
deeelwy committed Nov 26, 2013
1 parent 134b86b commit adc2840
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions t/bin-fetchware-new.t
Expand Up @@ -37,6 +37,12 @@ BEGIN {
}


SKIP: {
# Must be 1 less than the number of tests in the Test::More use line above.
my $how_many = 16;
skip 'Not on a terminal', $how_many unless -t;


subtest 'test opening_message() success' => sub {
print_ok(sub {opening_message()},
<<EOM, 'test opening_message() success.');
Expand Down Expand Up @@ -724,6 +730,8 @@ note("$fetchwarefile");
##BROKEN## expect_quit();
##BROKEN##};

} # #End of gigantic skip block.

# Remove this or comment it out, and specify the number of tests, because doing
# so is more robust than using this, but this is better than no_plan.
#done_testing()

0 comments on commit adc2840

Please sign in to comment.