Skip to content

Commit

Permalink
better example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 5, 2011
1 parent 2f52161 commit 7935f1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 1 addition & 4 deletions lib/Test/Mojo.pm
Expand Up @@ -381,10 +381,7 @@ following new ones.
Build absolute L<Mojo::URL> object for test server.
Note that this method is EXPERIMENTAL and might change without warning!
my $url = $t->build_url;
$url->userinfo('sri:secr3t');
$url->path('/protected');
$t->get_ok($url);
$t->get_ok($t->build_url->userinfo('sri:secr3t')->path('/protected'));
=head2 C<content_is>
Expand Down
8 changes: 3 additions & 5 deletions t/mojolicious/lite_app.t
Expand Up @@ -818,11 +818,9 @@ $t->get_ok('/regex/in/template')->status_is(200)
->content_is("test(test)(\\Qtest\\E)(\n");

# GET /stream (with basic auth)
my $url = $t->build_url;
$url->userinfo('sri:foo');
$url->path('/stream');
$url->query(foo => 'bar');
$t->get_ok($url)->status_is(200)->header_is(Server => 'Mojolicious (Perl)')
$t->get_ok(
$t->build_url->userinfo('sri:foo')->path('/stream')->query(foo => 'bar'))
->status_is(200)->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_like(qr/^foobarsri\:foohttp:\/\/localhost\:\d+\/stream$/);

Expand Down

0 comments on commit 7935f1a

Please sign in to comment.