X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Flive_engine_response_perlio.t;fp=t%2Faggregate%2Flive_engine_response_perlio.t;h=f1bd24431b5fcacaa2a6b769c2a04e163381964e;hp=0000000000000000000000000000000000000000;hb=c9373e697672ade084d08684f95ae2fcd83bfd88;hpb=1e08932999c6102add7c2abfe147d2aa7e14f1d5 diff --git a/t/aggregate/live_engine_response_perlio.t b/t/aggregate/live_engine_response_perlio.t new file mode 100644 index 0000000..f1bd244 --- /dev/null +++ b/t/aggregate/live_engine_response_perlio.t @@ -0,0 +1,40 @@ +#!perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../lib"; + +use Test::More; +use Catalyst::Test 'TestApp'; + +my $types = { + #zip => ['Archive::Zip', 464, qr/^PK\x03\x04.*[\x80-\xFF]+.*x.txt/s], + ### Archive::Zip currently unreliable as a test platform until RT #54827 is fixed and popularized ### + ### https://rt.cpan.org/Ticket/Display.html?id=54827 ### + + csv => ['Text::CSV', 96, qr/"Banana \(single\)","\$ \.40"$/m], + xml => ['XML::Simple', 1657, qr()], +}; + +plan tests => scalar keys %$types; + +for my $action ( keys %$types ) { + my ($module, $length, $regexp) = @{$types->{$action}}; + + subtest uc($action)." Set" => sub { + undef $@; + eval "require $module"; # require hates string class names; must use eval string instead of block + print $@; + plan ($@ ? (skip_all => $module.' not installed') : (tests => 4) ); + + ok( my $response = request('http://localhost/engine/response/perlio/' . $action ), "Request" ); + ok( $response->is_success, "Response Successful 2xx" ); + is( length( $response->content ), $length, "Length OK" ); + like( $response->content, $regexp, "RegExp Check OK" ); + done_testing(); + }; +} + +done_testing();