Skip to content

Instantly share code, notes, and snippets.

@yko

yko/async.t Secret

Created February 18, 2011 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yko/068b7ffe5cd281719cac to your computer and use it in GitHub Desktop.
Save yko/068b7ffe5cd281719cac to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use Test::More;
use Test::Mojo;
use Mojolicious::Lite;
plan tests => 3;
get '/' => sub {
my $c = shift;
my $async = $c->client->async;
$async->get('http://mojolicio.us' =>
sub { pass "Mojolicious page fetched"; $c->render_text('Ok') });
};
my $t = Test::Mojo->new(app => app);
$t->get_ok('/')->content_is('Ok');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment