Skip to content

Commit 5ddbe08

Browse files
committed
more test
1 parent 3cdcc3e commit 5ddbe08

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
!/root/assets/.gitignore
12
*.bak
23
*.sw*
34
.DS_Store
@@ -17,8 +18,7 @@
1718
/node_modules/
1819
/perltidy.LOG
1920
/pm_to_blib
21+
/root/assets
2022
/root/static/sitemaps
2123
/tidyall.ERR
2224
/var
23-
/root/assets
24-
!/root/assets/.gitignore

lib/MetaCPAN/Middleware/Static.pm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Plack::App::File ();
66
use JavaScript::Minifier::XS ();
77
use Cwd qw( cwd );
88
use Plack::MIME ();
9-
use JSON::MaybeXS ();
9+
use JSON::MaybeXS ();
1010

1111
Plack::MIME->add_type(
1212
'.eot' => 'application/vnd.ms-fontobject',
@@ -40,7 +40,7 @@ sub wrap {
4040
};
4141

4242
my $assets;
43-
if (!$dev_mode) {
43+
if ( !$dev_mode ) {
4444
$assets = $get_assets->();
4545
}
4646

@@ -101,11 +101,12 @@ sub wrap {
101101
mount '/assets' => sub {
102102
my $env = shift;
103103
my $res = $assets_app->($env);
104-
push @{ $res->[1] }, (
104+
push @{ $res->[1] },
105+
(
105106
'Cache-Control' => "public, max-age=${year_ttl}, immutable",
106-
'Surrogate-Key' => 'assets',
107+
'Surrogate-Key' => 'assets',
107108
'Surrogate-Control' => "max-age=${year_ttl}",
108-
);
109+
);
109110
return $res;
110111
};
111112

t/tidyall.t

100644100755
Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,27 @@
33
use strict;
44
use warnings;
55

6-
# This test is _really_ slow on Travis with Devel::Cover running. Also,
6+
# This test is _really_ slow with Devel::Cover running. Also,
77
# there's really no reason to run this when coverage tests are running, since
88
# it's not bringing anything to the table.
9+
use Test::More $ENV{COVERAGE}
10+
? ( skip_all => 'skip under Devel::Cover' )
11+
: ();
12+
13+
use File::Temp ();
914

1015
use Test::Code::TidyAll qw( tidyall_ok );
11-
use Test::More
12-
do { $ENV{COVERAGE} ? ( skip_all => 'skip under Devel::Cover' ) : () };
13-
tidyall_ok( verbose => $ENV{TEST_TIDYALL_VERBOSE} );
16+
17+
my %opts = ( verbose => $ENV{TEST_TIDYALL_VERBOSE}, );
18+
19+
if ( -e '.tidyall.d' ? !-w _ : !-w '.' ) {
20+
$opts{data_dir} = File::Temp::tempdir(
21+
TEMPLATE => 'tidyall-XXXXXX',
22+
TMPDIR => 1,
23+
CLEANUP => 1,
24+
);
25+
}
26+
27+
tidyall_ok(%opts);
1428

1529
done_testing();

0 commit comments

Comments
 (0)