File: run.t

package info (click to toggle)
libmojolicious-plugin-cgi-perl 0.36-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 208 kB
  • ctags: 17
  • sloc: perl: 300; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 333 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use t::Helper;

use Mojolicious::Lite;

plugin CGI => {
  route => '/',
  run => sub {
    print "HTTP/1.1 200 OK\r\n";
    print "Content-Type: text/html; charset=ISO-8859-1\r\n";
    print "\r\n";
    print "<body><p>Hi!\n";
  },
};

my $t = Test::Mojo->new;

$t->get_ok('/')->status_is(200)->content_like(qr/Hi!/);

done_testing;