タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

plackとtestに関するhokacchaのブックマーク (2)

  • HTTP クライアントのテストを Plack でやる方法について - tokuhirom's blog

    勝手に添削なかんじで。 http://d.hatena.ne.jp/Craftworks/20100819/1282237375 をみていておもったのですが、変にがんばるよりも、Test::TCP を直接つかってかいちゃった方が楽なのでは。 use strict; use warnings; use Test::More; use Test::TCP; use Plack::Loader; use LWP::Simple qw/get/; my $app = sub { my $env = shift; my $content = 'something'; # something return [ 200, [ 'Content-Type' => 'text/plain' ], [ $content ] ]; }; my $client = sub { my $base = shift;

  • おさかなラボ - Plack::Testが凄い!

    Twitter経由でPlack::Testを見た。なにこれ。もうCGIいらないじゃん。 PlackやPSGIを知らない人は先に適当なページでも見て頂きたい。そんなんよりPSGIのエントリ書いてほしいって方はコメント残しておいてください。でももう半年も経つからググればいっぱい見つかるんじゃないかな。俺ほとんどPSGIに首突っ込んでないし。 で、Plack::Testの何がどうすごいかというと、次のようにPSGIアプリケーションのテストができる。テストコードは宮川さんのものに、クエリ部分を付け加えたものだ。 use Plack::Test; use Test::More; use HTTP::Request; use strict; use warnings; my $app = sub { my $env = shift; my $query = { map { split(/=/) } s

  • 1