Debian Codegraph @

t/27-form_number.t

raw
1 #!/usr/bin/perl -w
2 use strict;
3 use lib './inc';
4 use IO::Catch;
5
6 our ($_STDOUT_, $_STDERR_);
7 tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!;
8 tie *STDERR, 'IO::Catch', '_STDERR_' or die $!;
9
10 use Test::More tests => 4;
11
12 # Disable all ReadLine functionality
13 $ENV{PERL_RL} = 0;
14 delete $ENV{PAGER}
15 if $ENV{PAGER};
16 $ENV{PERL_HTML_DISPLAY_CLASS}="HTML::Display::Dump";
17
18 my @warnings;
19
20 use_ok('WWW::Mechanize::Shell');
21 my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef );
22
23 my @status;
24 { no warnings qw'once redefine';
25 *WWW::Mechanize::Shell::status = sub {};
26 };
27
28 $s->cmd('get file:t/27-index.html');
29 $s->option('warnings',1);
30 eval {
31 $s->cmd("form 2");
32 };
33 is($@, '', "Can execute 'form 2' for a page with two forms");
34 is($_STDOUT_,undef,"Nothing was printed");
35 is($_STDERR_,undef,"No warnings printed");
36