Skip to content

Instantly share code, notes, and snippets.

@hisaichi5518
Created August 9, 2012 06:43
Show Gist options
  • Select an option

  • Save hisaichi5518/3301745 to your computer and use it in GitHub Desktop.

Select an option

Save hisaichi5518/3301745 to your computer and use it in GitHub Desktop.
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