1 # Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
7 use File::Temp qw/tempdir/;
8 my $tmpdir = tempdir('psgi-text-XXXXXX', TMPDIR => 1, CLEANUP => 1);
9 my $maindir = "$tmpdir/main.git";
10 my $addr = 'test-public@example.com';
11 my $cfgpfx = "publicinbox.test";
12 my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape);
13 foreach my $mod (@mods) {
15 plan skip_all => "$mod missing for psgi_text.t" if $@;
17 use_ok $_ foreach @mods;
18 use PublicInbox::Import;
20 use PublicInbox::Config;
22 use_ok 'PublicInbox::WwwText';
24 my $config = PublicInbox::Config->new({
25 "$cfgpfx.address" => $addr,
26 "$cfgpfx.mainrepo" => $maindir,
28 is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
29 my $www = PublicInbox::WWW->new($config);
31 test_psgi(sub { $www->call(@_) }, sub {
34 $res = $cb->(GET('/test/_/text/help/'));
35 like($res->content, qr!<title>public-inbox help.*</title>!,