Skip to content

Commit

Permalink
better namespace precedence tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 20, 2012
1 parent 6d2ceb0 commit c24e99b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion t/mojolicious/app.t
Expand Up @@ -249,7 +249,7 @@ $t->get_ok('/test9')->status_is(200)
$t->get_ok('/test10')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is('Development namespace works again!');
->content_is('Development namespace has high precedence!');

# 404
$t->get_ok('/' => {'X-Test' => 'Hi there!'})->status_is(404)
Expand Down
5 changes: 1 addition & 4 deletions t/mojolicious/lib/MojoliciousTest/Baz.pm
@@ -1,9 +1,6 @@
package MojoliciousTest::Baz;
use Mojo::Base 'Mojolicious::Controller';

sub index {
my $self = shift;
$self->render(text => 'Production namespace works again!');
}
sub index { shift->render_text('Production namespace has low precedence!') }

1;
7 changes: 2 additions & 5 deletions t/mojolicious/lib/MojoliciousTest3/Baz.pm
@@ -1,9 +1,6 @@
package MojoliciousTest3::Baz;
use Mojo::Base 'Mojolicious::Controller';
use Mojo::Base 'MojoliciousTest::Baz';

sub index {
my $self = shift;
$self->render(text => 'Development namespace works again!');
}
sub index { shift->render_text('Development namespace has high precedence!') }

1;
2 changes: 1 addition & 1 deletion t/mojolicious/production_app.t
Expand Up @@ -130,6 +130,6 @@ $t->get_ok('/test9' => {'X-Test' => 'Hi there!'})->status_is(404)
$t->get_ok('/test10')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is('Production namespace works again!');
->content_is('Production namespace has low precedence!');

done_testing();

0 comments on commit c24e99b

Please sign in to comment.