| 1 |
|
| 2 |
use ExtUtils::testlib; |
| 3 |
use Test::More 'no_plan'; |
| 4 |
|
| 5 |
my $sMod; |
| 6 |
BEGIN |
| 7 |
{ |
| 8 |
$sMod = 'WWW::Search::Null::Error'; |
| 9 |
use_ok('WWW::Search'); |
| 10 |
use_ok($sMod); |
| 11 |
} # end of BEGIN block |
| 12 |
ok(my $iCount = 4); |
| 13 |
ok(my $oSearch = new WWW::Search('Null::Error')); |
| 14 |
isa_ok($oSearch, $sMod); |
| 15 |
$oSearch->native_query('Makes no difference what you search for...'); |
| 16 |
my @aoResults = $oSearch->results; |
| 17 |
is(scalar(@aoResults), 0, 'got zero results'); |
| 18 |
is($oSearch->approximate_result_count, undef, 'got the right approx_results'); |
| 19 |
# ...But you get an HTTP::Response object with a code of 200 |
| 20 |
my $oResponse = $oSearch->response; |
| 21 |
is($oResponse->code, 500, 'response code'); |
| 22 |
ok(! $oResponse->is_success, 'got an HTTP failure'); |
| 23 |
|
| 24 |
__END__ |