first worker
[MojoX-Gearman.git] / t / gearman.t
index 9a3c60c..4df77c5 100755 (executable)
@@ -2,12 +2,20 @@
 use warnings;
 use strict;
 
-use Test::More tests => 4;
+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( 16, "foobar" ), 'echo' );
+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?' );
+