Guest User

Untitled

a guest
Dec 12th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. package Foo;
  2. use Mojo::Base 'Mojolicious';
  3. use Mojolicious::Commands;
  4.  
  5. sub startup { shift->routes->route('/')->to({text => 'YO'}) }
  6. $ENV{MOJO_APP} = 'Foo';
  7.  
  8. use Test::More tests => 3;
  9. use Test::Mojo;
  10. my $t = Test::Mojo->new;
  11. $t->get_ok('/')->content_is('YO')->header_is(Server => 'Mojolicious (Perl)');
  12.  
  13. __END__
  14. 1..3
  15. Use of uninitialized value $host in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.12.1/Mojo/UserAgent.pm line 268.
  16. Use of uninitialized value $_ in join or string at /usr/local/lib/perl5/site_perl/5.12.1/Mojo/Headers.pm line 164.
  17. Use of uninitialized value in join or string at /usr/local/lib/perl5/site_perl/5.12.1/Mojo/UserAgent.pm line 386.
  18. ok 1 - get /
  19. not ok 2 - exact match for content
  20. # Failed test 'exact match for content'
  21. # at foo.pl line 11.
  22. # got: '<html><body><h1>It works!</h1></body></html>'
  23. # expected: 'YO'
  24. not ok 3 - Server: Mojolicious (Perl)
  25. # Failed test 'Server: Mojolicious (Perl)'
  26. # at foo.pl line 11.
  27. # 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'
  28. # expected: 'Mojolicious (Perl)'
  29. # Looks like you failed 2 tests of 3.
Add Comment
Please, Sign In to add comment