X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Foptional_stress.t;h=620c840e6e5fc5d7ac7ae8aa87b276196b21dd05;hp=c0f259770e9227c918c3fa37e4ee47a7b89213ab;hb=6c217fb3c36a6e0ac4ef82b839ee3d5ed924e2e5;hpb=15f0ede8ee33bc9b0c002221a8e62f59e8b7b7e2 diff --git a/t/optional_stress.t b/t/optional_stress.t index c0f2597..620c840 100644 --- a/t/optional_stress.t +++ b/t/optional_stress.t @@ -1,25 +1,29 @@ -#!perl - use strict; use warnings; +use Test::More; +BEGIN { + plan skip_all => 'set TEST_STRESS to enable this test' + unless $ENV{TEST_STRESS}; +} + use FindBin; use lib "$FindBin::Bin/lib"; - -use Test::More; use Catalyst::Test 'TestApp'; our ( $iters, $tests ); BEGIN { - plan skip_all => 'set TEST_STRESS to enable this test' - unless $ENV{TEST_STRESS}; + use JSON::MaybeXS qw(decode_json); - eval "use YAML"; - plan skip_all => 'YAML is required for this test' if $@; + my $test_data = do { + open my $fh, '<:raw', "$FindBin::Bin/optional_stress.json" or die "$!"; + local $/; + <$fh>; + }; $iters = $ENV{TEST_STRESS} || 10; - $tests = YAML::LoadFile("$FindBin::Bin/optional_stress.yml"); + $tests = decode_json($test_data); my $total_tests = 0; map { $total_tests += scalar @{ $tests->{$_} } } keys %{$tests};