From d473ac3bfe1f487e13c07e8ee9936f07a1dd6e89 Mon Sep 17 00:00:00 2001 From: Alex Balhatchet Date: Sat, 5 Dec 2015 09:24:22 +0000 Subject: [PATCH 1/2] Update dist.ini to kill some warnings Some deprecated plugins with handy replacement suggestions: [CompileTests] is deprecated ... replace it with [Test::Compile] [CriticTests] is deprecated ... replace it with [Test::Perl::Critic] [PodSpellingTests] is deprecated ... replace it with [Test::PodSpelling] [ReportVersions::Tiny] is deprecated ... rommended alternative: [Test::ReportPrereqs] --- One error for colliding plugins both trying to provide the same element: "Duplication of element resources.bugtracker.web" [@Github] and [Repository] were both trying to provide it I believe. I removed [Repository]. --- MinimumPerl tripping up on the t/LWPtmp directory's contents: [MinimumPerl] Unable to parse 't/LWPtmp/ec3ab5b3ac924eb17397d5954d7aef9b' --- dist.ini | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dist.ini b/dist.ini index 06b705e..c859ef9 100644 --- a/dist.ini +++ b/dist.ini @@ -19,32 +19,33 @@ authority = cpan:EALLENIII [PkgVersion] [PodWeaver] -[CompileTests] +[Test::Compile] fake_home = 1 [ExtraTests] -[CriticTests] +[Test::Perl::Critic] critic_config = t/perlcriticrc [PodCoverageTests] [PodSyntaxTests] [Test::Pod::LinkCheck] -[PodSpellingTests] +[Test::PodSpelling] stopwords = LICENCE stopwords = PASSed stopwords = annonations stopwords = MERCHANTABILITY -[ReportVersions::Tiny] +[Test::ReportPrereqs] [ExecDir] dir = bin +[FileFinder::Filter / SkipLWPRecorderCache] +finder = :TestFiles +skip = t/LWPtmp/.*$ [MinimumPerl] +test_finder = SkipLWPRecorderCache [AutoPrereqs] skip = ^MyApp -[Bugtracker] [Homepage] [MetaConfig] [MetaData::BuiltWith] -[Repository] -git_remote = origin [MetaResources] license = http://dev.perl.org/licenses/ [MetaNoIndex] From 3f3af1f340a2ca5dabf3d89458581d95cbbc015f Mon Sep 17 00:00:00 2001 From: Alex Balhatchet Date: Sat, 5 Dec 2015 09:35:55 +0000 Subject: [PATCH 2/2] Fix PerlCritic CodeLayout::ProhibitHashBarewords violations --- lib/Test/LWP/Recorder.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/Test/LWP/Recorder.pm b/lib/Test/LWP/Recorder.pm index 373dcea..03121f6 100644 --- a/lib/Test/LWP/Recorder.pm +++ b/lib/Test/LWP/Recorder.pm @@ -18,20 +18,20 @@ use HTTP::Response; sub new { my $class = shift; my %defaults = ( - record => 0, - cache_dir => 't/LWPCache', - filter_params => [], - filter_header => [qw(Client-Peer Expires Client-Date Cache-Control)], + 'record' => 0, + 'cache_dir' => 't/LWPCache', + 'filter_params' => [], + 'filter_header' => [qw(Client-Peer Expires Client-Date Cache-Control)], ); my $params = shift || {}; my $self = $class->SUPER::new(@_); - $self->{_test_options} = { %defaults, %{$params} }; + $self->{'_test_options'} = { %defaults, %{$params} }; return $self; } sub _filter_param { my ( $self, $key, $value ) = @_; - my %filter = map { $_ => 1 } @{ $self->{_test_options}->{filter_params} }; + my %filter = map { $_ => 1 } @{ $self->{'_test_options'}->{'filter_params'} }; return join q{=}, $key, $filter{$key} ? q{} : $value; } @@ -64,13 +64,13 @@ sub _get_cache_key { . $self->_filter_all_params($params); #warn "Key is $key"; - return File::Spec->catfile( $self->{_test_options}->{cache_dir}, + return File::Spec->catfile( $self->{'_test_options'}->{'cache_dir'}, md5_hex($key) ); } sub _filter_headers { my ( $self, $response ) = @_; - foreach ( @{ $self->{_test_options}->{filter_header} } ) { + foreach ( @{ $self->{'_test_options'}->{'filter_header'} } ) { $response->remove_header($_); } return; @@ -82,7 +82,7 @@ sub request { my $key = $self->_get_cache_key($request); - if ( $self->{_test_options}->{record} ) { + if ( $self->{'_test_options'}->{'record'} ) { my $response = $self->SUPER::request(@original_args); my $cache_response = $response->clone;