=================================================================== RCS file: /cvs/HOPE/Net-OpenAMD/t/local_server.t,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- HOPE/Net-OpenAMD/t/local_server.t 2010/07/01 18:59:55 1.11 +++ HOPE/Net-OpenAMD/t/local_server.t 2010/07/13 03:27:06 1.12 @@ -1,5 +1,5 @@ #!perl -# $AFresh1: local_server.t,v 1.10 2010/06/30 05:30:17 andrew Exp $ +# $AFresh1: local_server.t,v 1.11 2010/07/01 17:59:55 andrew Exp $ use Test::More; use strict; @@ -14,97 +14,18 @@ eval "use Test::Mojo::Server"; if ($@) { - plan skip_all => "Test::Mojo::Server required for testing local server"; + plan skip_all => + "Test::Mojo::Server required for testing local server"; } - elsif ($] < 5.01) { + elsif ( $] < 5.01 ) { plan skip_all => 'test_server.pl requires perl 5.10 or higher'; } else { - plan tests => 15; + plan tests => 17; } require 'network_tests.t'; } -my %tests = ( - location => [ - { args => undef, - expect => [ - { 'y' => '83.1452331542969', - 'area' => 'Engressia', - 'time' => 2387, - 'user' => 12983, - 'x' => '46.7369918823242', - 'button' => 'False' - } - ], - }, - ], - speakers => [ - { args => undef, - expect => [ - { 'name' => 'Johnny', - 'bio' => 'Johnny\'s bio' - }, - ], - }, - ], - talks => [ - { args => undef, - expect => [ - { 'speakers' => [ 'Judas', 'JohnnyX' ], - 'interests' => [ 'media', 'crypto' ], - 'time' => '2008/7/18 13:00:00', - 'track' => 'Hooper', - 'title' => 'Ancient Egyptian Music and DRM', - 'abstract' => - 'A discussion of the development of musical notation, which was designed as a means of reproducing music while making it impossible for the general public to perform without permission.' - } - ], - }, - ], - interests => [ - { args => undef, - expect => [ - 'new tech', 'activism', - 'radio', 'lockpicking', - 'crypto', 'privacy', - 'ethics', 'telephones', - 'social engineering', 'hacker spaces', - 'hardware hacking', 'nostalgia', - 'communities', 'science', - 'government', 'network security', - 'malicious software', 'pen testing', - 'web', 'niche hacks', - 'media', - ], - }, - ], - users => [ - { args => undef, - expect => [ - { 'name' => 'JohnnyX', - 'x' => '32.54091324', - 'y' => '54.10958384', - 'interests' => [ - 'new tech', 'radio', - 'lockpicking', 'crypto', - 'telephones', 'social engineering', - 'hacker spaces', 'hardware hacking', - 'nostalgia', 'communities', - 'science', 'network security', - 'malicious software', 'pen testing' - ], - } - ] - }, - ], - stats => [ - { args => undef, - expect => qr/^Unused \s feature/xms, - }, - ], -); - my $server = Test::Mojo::Server->new(); $server->executable('test_server.pl'); @@ -114,7 +35,7 @@ my $amd = Net::OpenAMD->new( { base_uri => 'http://127.0.0.1:' . $port . '/api/', } ); -NetworkTests::run_tests( $amd, \%tests ); +NetworkTests::run_tests($amd); $server->stop_server_ok('server stopped');