3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 10; |
use Test::More tests => 12; |
7 |
use Test::Exception; |
use Test::Exception; |
8 |
use Data::Dumper; |
use Data::Dumper; |
9 |
|
|
10 |
BEGIN { use_ok('Search::Estraier') }; |
BEGIN { use_ok('Search::Estraier') }; |
11 |
|
|
12 |
|
# name of node for test |
13 |
|
my $test_node = 'Search-Estraier'; |
14 |
|
|
15 |
ok(my $node = new Search::Estraier::Node, 'new'); |
ok(my $node = new Search::Estraier::Node, 'new'); |
16 |
isa_ok($node, 'Search::Estraier::Node'); |
isa_ok($node, 'Search::Estraier::Node'); |
17 |
|
|
26 |
ok($node->set_auth('foo','bar'), 'set_auth'); |
ok($node->set_auth('foo','bar'), 'set_auth'); |
27 |
|
|
28 |
cmp_ok($node->status, '==', -1, 'status'); |
cmp_ok($node->status, '==', -1, 'status'); |
29 |
|
|
30 |
|
my $nodelist; |
31 |
|
foreach my $url (qw{?action=nodelist http://localhost/master_ui?action=nodelist}) { |
32 |
|
cmp_ok( |
33 |
|
$node->shuttle_url( $url, 'text/plain', undef, \$nodelist) |
34 |
|
,'==', 200, 'nodelist'); |
35 |
|
} |
36 |
|
|
37 |
|
my $draft = <<'_END_OF_DRAFT_'; |
38 |
|
@uri=data001 |
39 |
|
@title=Material Girl |
40 |
|
|
41 |
|
Living in a material world |
42 |
|
And I am a material girl |
43 |
|
You know that we are living in a material world |
44 |
|
And I am a material girl |
45 |
|
_END_OF_DRAFT_ |
46 |
|
|
47 |
|
diag "draft:\n$draft"; |