Skip to content

Commit

Permalink
every ojo one-liner is a Mojolicious::Lite application
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 24, 2014
1 parent 7d4f78d commit d28b63a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ojo.pm
Expand Up @@ -75,6 +75,10 @@ C<MOJO_PROXY> environment variable.
$ MOJO_PROXY=0 perl -Mojo -E 'say g("example.com")->body'
Every L<ojo> one-liner is also a L<Mojolicious::Lite> application.
$ perl -Mojo -E 'get "/" => {inline => "%= time"}; app->start' get /
=head1 FUNCTIONS
L<ojo> implements the following functions, which are automatically exported.
Expand Down
4 changes: 4 additions & 0 deletions t/mojolicious/ojo.t
Expand Up @@ -27,6 +27,10 @@ is p('/' => form => {foo => 'bar'})->body, 'POSTfoo=bar', 'right content';
is p('/' => json => {foo => 'bar'})->body, 'POST{"foo":"bar"}',
'right content';

# Mojolicious::Lite
get '/test' => {text => 'pass'};
is app->ua->get('/test')->res->body, 'pass', 'right content';

# Parse XML
is x('<title>works</title>')->at('title')->text, 'works', 'right text';

Expand Down

0 comments on commit d28b63a

Please sign in to comment.