Changeset 489 for wiki-toolkit-plugin-ping/trunk/t/02_call.t
- Timestamp:
- 01/31/09 14:16:16 (3 years ago)
- Files:
-
- 1 modified
-
wiki-toolkit-plugin-ping/trunk/t/02_call.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wiki-toolkit-plugin-ping/trunk/t/02_call.t
r488 r489 14 14 plan skip_all => 'SQLite not availalbe'; 15 15 } else { 16 plan tests => 4;16 plan tests => 5; 17 17 } 18 18 … … 26 26 my $wiki = Wiki::Toolkit->new( store=>$store ); 27 27 28 my $port = 112233; 28 29 29 30 # Listen on a special port, so we can check a ping happened 30 31 my $sock = new IO::Socket::INET ( 31 LocalPort => 112233,32 LocalPort => $port, 32 33 Proto => 'tcp', 33 34 Listen => 1, 34 35 ); 35 36 unless($sock) { 36 die("Can't listen on port 112233for test");37 die("Can't listen on port $port for test"); 37 38 } 38 39 … … 42 43 node_to_url => "http://wiki.org/\$node", 43 44 services => { 44 test => "http://localhost:112233/url=\$url" 45 } 45 test => "http://localhost:$port/url=\$url" 46 }, 47 agent => "Wiki::Toolkit::Plugin::Ping test suite", 46 48 ); 47 49 ok( $plugin, "Plugin was created OK with the local URL" ); … … 74 76 my $allreq = join "\n", @req; 75 77 like( $req[0], qr/^GET \/url=http:\/\/wiki.org\/TestNode/, "Did right get" ); 76 like( $allreq, qr/^Host: localhost:112233/m, "Correct http/1.1 host" ); 78 like( $allreq, qr/^Host: localhost:$port/m, "Correct http/1.1 host" ); 79 like( $allreq, qr/^User-Agent: Wiki::Toolkit::Plugin::Ping test suite/m, "Correct user-agent" ); 77 80 78 81 # Send them an OK
