Dancer2-Plugin-Swagger2
view release on metacpan or search on metacpan
xt/example.t view on Meta::CPAN
use HTTP::Request::Common;
use Plack::Test;
use Test::More;
# XS module load failure fatal in eval block -> eval string
eval "use YAML::XS; 1" or plan skip_all => "YAML::XS needed for this test";
plan tests => 3;
$ENV{DANCER_APPHANDLER} = 'PSGI';
ok( my $app = require "$FindBin::Bin/../example/my_app.pl" );
my $test = Plack::Test->create($app);
my $res = $test->request( GET '/api/welcome' );
like $res->content => qr/hello.+world/i;
is $res->code => 200;
( run in 0.294 second using v1.01-cache-2.11-cpan-0d8aa00de5b )