--- trunk/t/5_Node.t 2006/01/05 15:21:41 28 +++ trunk/t/5_Node.t 2006/01/05 21:51:29 35 @@ -3,12 +3,42 @@ use strict; use blib; -use Test::More tests => 3; +use Test::More tests => 11; use Test::Exception; use Data::Dumper; BEGIN { use_ok('Search::Estraier') }; +# name of node for test +my $test_node = 'Search-Estraier'; + ok(my $node = new Search::Estraier::Node, 'new'); isa_ok($node, 'Search::Estraier::Node'); +ok($node->set_url('http://localhost:1978/'), 'set_url'); + +ok($node->set_proxy('proxy.example.com', 8080), 'set_proxy'); +throws_ok {$node->set_proxy('proxy.example.com', 'foo') } qr/port/, 'set_proxy port NaN'; + +ok($node->set_timeout(42), 'set_timeout'); +throws_ok {$node->set_timeout('foo') } qr/timeout/, 'set_timeout NaN'; + +ok($node->set_auth('foo','bar'), 'set_auth'); + +cmp_ok($node->status, '==', -1, 'status'); + +my $nodelist; +cmp_ok($node->shuttle_url( '?action=nodelist', 'text/plain', undef, \$nodelist), + '==', 200, 'nodelist'); + +my $draft = <<'_END_OF_DRAFT_'; +@uri=data001 +@title=Material Girl + +Living in a material world +And I am a material girl +You know that we are living in a material world +And I am a material girl +_END_OF_DRAFT_ + +diag "draft:\n$draft";