Annotation of HOPE/Net-OpenAMD/t/local_server.t, Revision 1.6
1.1 andrew 1: #!perl
1.6 ! andrew 2: # $AFresh1: local_server.t,v 1.5 2010/06/27 00:52:33 andrew Exp $
1.5 andrew 3: use Test::More; # tests => 75;
1.1 andrew 4:
5: use strict;
6: use warnings;
7:
1.4 andrew 8: use Net::OpenAMD;
1.1 andrew 9:
10: BEGIN {
1.2 andrew 11: use FindBin;
1.4 andrew 12: use lib "$FindBin::Bin";
13: use lib "$FindBin::Bin/../../mojo/lib";
1.2 andrew 14:
1.1 andrew 15: eval "use Test::Mojo::Server";
1.5 andrew 16: plan skip_all => "Test::Mojo::Server required for testing local server"
17: if $@;
1.4 andrew 18: require 'network_tests.t';
1.1 andrew 19: }
20:
21: my $server = Test::Mojo::Server->new();
22: $server->executable('test_server.pl');
23:
24: my $path = $server->find_executable_ok('executable found');
25: my $port = $server->start_daemon_ok('daemon test');
26: $server->server_ok('server running');
27:
1.5 andrew 28: my $amd = Net::OpenAMD->new(
1.6 ! andrew 29: { base_url => 'http://127.0.0.1:' . $port . '/api/', } );
1.4 andrew 30: NetworkTests::run_tests($amd);
1.1 andrew 31:
1.5 andrew 32: $server->stop_server_ok('server stopped');
1.1 andrew 33:
34: done_testing();
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>