Skip to content

Instantly share code, notes, and snippets.

@bduggan
Created July 22, 2011 12:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bduggan/1099355 to your computer and use it in GitHub Desktop.
Save bduggan/1099355 to your computer and use it in GitHub Desktop.
#!perl
package TestApp;
use Mojolicious::Lite;
get '/one/:foo' => [ foo => [qw/bar barfly/] ] => sub { shift->render_text('hi') };
get '/two/:foo' => [ foo => qr[bar|barfly] ] => sub { shift->render_text('hi') };
package main;
use Test::More tests => 8;
use Test::Mojo;
my $t = Test::Mojo->new("TestApp");
$t->get_ok("/one/bar")->status_is('200');
$t->get_ok("/one/barfly")->status_is('200');
$t->get_ok("/two/bar")->status_is('200');
$t->get_ok("/two/barfly")->status_is('200');
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment