Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Foo;
- use Mojo::Base 'Mojolicious';
- use Mojolicious::Commands;
- sub startup { shift->routes->route('/')->to({text => 'YO'}) }
- $ENV{MOJO_APP} = 'Foo';
- use Test::More tests => 3;
- use Test::Mojo;
- my $t = Test::Mojo->new;
- $t->get_ok('/')->content_is('YO')->header_is(Server => 'Mojolicious (Perl)');
- __END__
- 1..3
- Use of uninitialized value $host in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.12.1/Mojo/UserAgent.pm line 268.
- Use of uninitialized value $_ in join or string at /usr/local/lib/perl5/site_perl/5.12.1/Mojo/Headers.pm line 164.
- Use of uninitialized value in join or string at /usr/local/lib/perl5/site_perl/5.12.1/Mojo/UserAgent.pm line 386.
- ok 1 - get /
- not ok 2 - exact match for content
- # Failed test 'exact match for content'
- # at foo.pl line 11.
- # got: '<html><body><h1>It works!</h1></body></html>'
- # expected: 'YO'
- not ok 3 - Server: Mojolicious (Perl)
- # Failed test 'Server: Mojolicious (Perl)'
- # at foo.pl line 11.
- # got: 'Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.8 mod_fastcgi/2.4.2'
- # expected: 'Mojolicious (Perl)'
- # Looks like you failed 2 tests of 3.
Add Comment
Please, Sign In to add comment