| 1 |
use strict; |
| 2 |
use Test::More tests => 4; |
| 3 |
|
| 4 |
# Disable all ReadLine functionality |
| 5 |
$ENV{PERL_RL} = 0; |
| 6 |
|
| 7 |
SKIP: { |
| 8 |
#skip "Can't load Term::ReadKey without a terminal", 4 |
| 9 |
# unless -t STDIN; |
| 10 |
|
| 11 |
eval { |
| 12 |
require Test::Without::Module; |
| 13 |
Test::Without::Module->import('Pod::Constants') |
| 14 |
}; |
| 15 |
skip "Need Test::Without::Module to test the fallback", 4 |
| 16 |
if $@; |
| 17 |
|
| 18 |
#eval { require Term::ReadKey; Term::ReadKey::GetTerminalSize(); }; |
| 19 |
#if ($@) { |
| 20 |
# no warnings 'redefine'; |
| 21 |
# *Term::ReadKey::GetTerminalSize = sub {80,24}; |
| 22 |
# diag "Term::ReadKey seems to want a terminal"; |
| 23 |
#}; |
| 24 |
|
| 25 |
use_ok("WWW::Mechanize::Shell"); |
| 26 |
my $shell = do { |
| 27 |
WWW::Mechanize::Shell->new("shell", rcfile => undef, warnings => undef ); |
| 28 |
}; |
| 29 |
|
| 30 |
isa_ok($shell,"WWW::Mechanize::Shell"); |
| 31 |
my $text; |
| 32 |
|
| 33 |
eval { |
| 34 |
$text = $shell->catch_smry('quit'); |
| 35 |
}; |
| 36 |
is( $@, '', "No error without Pod::Constants"); |
| 37 |
is( $text, undef, "No help without Pod::Constants"); |
| 38 |
}; |