]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/cgi.t: move expected failure tests to t/plack.t
authorEric Wong <e@80x24.org>
Fri, 4 Jan 2019 11:32:00 +0000 (11:32 +0000)
committerEric Wong <e@80x24.org>
Fri, 4 Jan 2019 11:32:00 +0000 (11:32 +0000)
No point in implementing these slowly with the CGI wrapper
when PSGI is sufficient for testing.

t/cgi.t
t/plack.t

diff --git a/t/cgi.t b/t/cgi.t
index a25d2eeb26bc7f7078d721233b83636da8c33c8c..e705cd76a77b0203aa4ecfccaa529047adb209c3 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -80,16 +80,6 @@ EOF
        $im->done;
 }
 
-# obvious failures, first
-{
-       local $ENV{HOME} = $home;
-       my $res = cgi_run("/", "", "PUT");
-       like($res->{head}, qr/Status:\s*405/i, "PUT not allowed");
-
-       $res = cgi_run("/");
-       like($res->{head}, qr/Status:\s*404/i, "index returns 404");
-}
-
 # message-id pages
 {
        local $ENV{HOME} = $home;
index 14c9b657f50cb5db1d3758ab693b89cfc533b484..9901186b7905501216d432aa68dc065ee9b835c4 100644 (file)
--- a/t/plack.t
+++ b/t/plack.t
@@ -240,6 +240,19 @@ EOF
                is(206, $res->code, 'got partial another response');
                is($res->content, substr($orig, 5), 'partial body OK past end');
        });
+
+       # things which should fail
+       test_psgi($app, sub {
+               my ($cb) = @_;
+
+               my $res = $cb->(PUT('/'));
+               is(405, $res->code, 'no PUT to / allowed');
+               $res = $cb->(PUT('/test/'));
+               is(405, $res->code, 'no PUT /$INBOX allowed');
+
+               # TODO
+               # $res = $cb->(GET('/'));
+       });
 }
 
 done_testing();