make non-/-terminated path matches allow an extension
[catagits/Web-Simple.git] / t / bloggery.t
CommitLineData
957088cd 1use strict;
2use warnings FATAL => 'all';
53d47b78 3
4use Test::More qw(no_plan);
5
6require_ok 'examples/bloggery/bloggery.cgi';
7
8__END__
957088cd 9use Test::More (
10 eval { require HTTP::Request::AsCGI }
11 ? 'no_plan'
12 : (skip_all => 'No HTTP::Request::AsCGI')
13);
14
15
16use HTTP::Request::Common qw(GET POST);
17
18require 'examples/bloggery/bloggery.cgi';
19
20my $app = Bloggery->new(
21 { config => { posts_dir => 'examples/bloggery/posts' } }
22);
23
24sub run_request {
25 my $request = shift;
26 my $c = HTTP::Request::AsCGI->new($request)->setup;
27 $app->run;
28 $c->restore;
29 return $c->response;
30}
31
32my $res;
33
39119082 34warn run_request(GET 'http://localhost/index.html')->as_string;
957088cd 35
39119082 36warn run_request(GET 'http://localhost/')->as_string;
957088cd 37
38warn run_request(GET 'http://localhost/One-Post.html')->as_string;
39
40warn run_request(GET 'http://localhost/Not-There.html')->as_string;
41
42warn run_request(POST 'http://localhost/One-Post.html')->as_string;