t/11-browse-without-request.t
raw| 1 | #!/usr/bin/perl -w |
| 2 | use strict; |
| 3 | |
| 4 | use Test::More tests => 2; |
| 5 | |
| 6 | BEGIN { |
| 7 | # Choose a nonannoying HTML displayer: |
| 8 | $ENV{PERL_HTML_DISPLAY_CLASS} = 'HTML::Display::Dump'; |
| 9 | # Disable all ReadLine functionality |
| 10 | $ENV{PERL_RL} = 0; |
| 11 | use_ok('WWW::Mechanize::Shell'); |
| 12 | }; |
| 13 | |
| 14 | my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef ); |
| 15 | |
| 16 | # Now test |
| 17 | eval { $s->cmd('browse'); }; |
| 18 | is($@, "", "Browsing without requesting anything does not crash the shell"); |
| 19 |