From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 208312141B for ; Fri, 4 Jan 2019 13:10:43 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 5/6] t/cgi.t: move expected failure tests to t/plack.t Date: Fri, 4 Jan 2019 13:10:37 +0000 Message-Id: <20190104131038.32233-6-e@80x24.org> In-Reply-To: <20190104131038.32233-1-e@80x24.org> References: <20190104131038.32233-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: No point in implementing these slowly with the CGI wrapper when PSGI is sufficient for testing. --- t/cgi.t | 10 ---------- t/plack.t | 13 +++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/t/cgi.t b/t/cgi.t index a25d2ee..e705cd7 100644 --- 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; diff --git a/t/plack.t b/t/plack.t index 14c9b65..9901186 100644 --- 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(); -- EW