1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/env perl use strict; use warnings; use Test::More; use Plack::Test::Agent; my $app = sub { my $content = shift->{HTTP_ACCEPT_LANGUAGE}; return [ 200, [], [ $content ] ]; }; my $agent = Plack::Test::Agent->new( app => $app ); my $res = $agent->get( '/', 'Accept-Language' => 'en' ); is $res->content, 'en'; done_testing;