From: Dobrica Pavlinusic Date: Tue, 1 Mar 2011 22:11:36 +0000 (+0000) Subject: rename tests X-Git-Url: http://git.rot13.org/?p=MojoX-Gearman.git;a=commitdiff_plain;h=d9175d53b2d9ec19e7433a4053b88953a75aa5b6 rename tests --- diff --git a/t/client.t b/t/client.t new file mode 100755 index 0000000..4df77c5 --- /dev/null +++ b/t/client.t @@ -0,0 +1,21 @@ +#!/usr/bin/env perl +use warnings; +use strict; + +use Test::More tests => 7; +use Data::Dump qw(dump); +use lib 'lib'; + +use_ok 'MojoX::Gearman'; + +my $g = new_ok 'MojoX::Gearman'; + +ok( my $echo = $g->req( 'ECHO_REQ', "foobar" ), 'ECHO' ); +cmp_ok $echo, 'eq', "foobar"; + +ok( my $ping = $g->req( 'SUBMIT_JOB', 'ping', '', 'bla' ), 'SUBMIT_JOB' ); +like $ping, qr/pong/, 'got pong'; +diag dump $ping; + +ok( $g->req( 'ECHO_REQ', "alive" ), 'ECHO - still alive - still alive?' ); + diff --git a/t/gearman-worker.t b/t/gearman-worker.t deleted file mode 100755 index dc06527..0000000 --- a/t/gearman-worker.t +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env perl -use warnings; -use strict; - -use Test::More tests => 7; -use Data::Dump qw(dump); -use lib 'lib'; - -use_ok 'MojoX::Gearman'; - -my $g = new_ok 'MojoX::Gearman'; - -my $name = "mojo_g"; - -ok( my $echo = $g->req( 'CAN_DO', $name, sub { - my $payload = shift; - warn "DO $name ", dump($payload), $/; - return $payload + 1; -}), 'CAN_DO' ); -diag $echo; - -$g->start; - -diag "press to finish"; -; - diff --git a/t/gearman.t b/t/gearman.t deleted file mode 100755 index 4df77c5..0000000 --- a/t/gearman.t +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env perl -use warnings; -use strict; - -use Test::More tests => 7; -use Data::Dump qw(dump); -use lib 'lib'; - -use_ok 'MojoX::Gearman'; - -my $g = new_ok 'MojoX::Gearman'; - -ok( my $echo = $g->req( 'ECHO_REQ', "foobar" ), 'ECHO' ); -cmp_ok $echo, 'eq', "foobar"; - -ok( my $ping = $g->req( 'SUBMIT_JOB', 'ping', '', 'bla' ), 'SUBMIT_JOB' ); -like $ping, qr/pong/, 'got pong'; -diag dump $ping; - -ok( $g->req( 'ECHO_REQ', "alive" ), 'ECHO - still alive - still alive?' ); - diff --git a/t/worker.t b/t/worker.t new file mode 100755 index 0000000..dc06527 --- /dev/null +++ b/t/worker.t @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +use warnings; +use strict; + +use Test::More tests => 7; +use Data::Dump qw(dump); +use lib 'lib'; + +use_ok 'MojoX::Gearman'; + +my $g = new_ok 'MojoX::Gearman'; + +my $name = "mojo_g"; + +ok( my $echo = $g->req( 'CAN_DO', $name, sub { + my $payload = shift; + warn "DO $name ", dump($payload), $/; + return $payload + 1; +}), 'CAN_DO' ); +diag $echo; + +$g->start; + +diag "press to finish"; +; +