=================================================================== RCS file: /cvs/HOPE/Net-OpenAMD/t/local_server.t,v retrieving revision 1.4 retrieving revision 1.14 diff -u -r1.4 -r1.14 --- HOPE/Net-OpenAMD/t/local_server.t 2010/06/26 17:33:33 1.4 +++ HOPE/Net-OpenAMD/t/local_server.t 2010/07/17 13:12:32 1.14 @@ -1,21 +1,28 @@ #!perl -# $AFresh1: local_server.t,v 1.3 2010/06/26 14:14:36 andrew Exp $ -use Test::More;# tests => 75; +# $AFresh1: local_server.t,v 1.13 2010/07/13 03:37:47 andrew Exp $ +use Test::More; use strict; use warnings; use Net::OpenAMD; -my $have_test_json = 1; - BEGIN { use FindBin; use lib "$FindBin::Bin"; use lib "$FindBin::Bin/../../mojo/lib"; eval "use Test::Mojo::Server"; - plan skip_all => "Test::Mojo::Server required for testing local server" if $@; + if ($@) { + plan skip_all => + "Test::Mojo::Server required for testing local server"; + } + elsif ( $] < 5.01 ) { + plan skip_all => 'test_server.pl requires perl 5.10 or higher'; + } + else { + plan tests => 18; + } require 'network_tests.t'; } @@ -26,11 +33,10 @@ my $port = $server->start_daemon_ok('daemon test'); $server->server_ok('server running'); -# XXX tests here -my $amd = Net::OpenAMD->new(); +my $amd = Net::OpenAMD->new( + { base_uri => 'http://127.0.0.1:' . $port . '/api/', } ); NetworkTests::run_tests($amd); -$server->stop_server_ok('server stopped'); +$server->stop_server_ok('server stopped'); - -done_testing(); +#done_testing();