Created
August 9, 2012 06:43
-
-
Save hisaichi5518/3301745 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package t::Util; | |
| use strict; | |
| use warnings; | |
| use Malts::Test (); | |
| use Exporter 'import'; | |
| our @EXPORT = qw/apptest/; | |
| my $builder = Test::More->builder; | |
| binmode $builder->output, ":utf8"; | |
| binmode $builder->failure_output, ":utf8"; | |
| binmode $builder->todo_output, ":utf8"; | |
| sub apptest { | |
| my ($note, $client) = @_; | |
| subtest $note => sub { | |
| Malts::Test::apptest( | |
| impl => 'MockHTTP', | |
| app => Plack::Util::load_psgi('./apptest.psgi'), | |
| client => $client, | |
| ); | |
| }; | |
| }; | |
| package main; | |
| use strict; | |
| use warnings; | |
| use utf8;; | |
| use t::Util; | |
| use HTTP::Request::Common; | |
| apptest '結婚が成立する' => sub { | |
| my ($app) = @_; | |
| my ($res, $c) = $app->(POST '/marry', [ | |
| bride => 'yoshitaka-yuriko', | |
| groom => 'hisaichi5518' | |
| ]); | |
| like $c->flash('notice'), qr/結婚が成立しました/; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment