From: André Walker Date: Mon, 1 Aug 2011 23:28:18 +0000 (-0300) Subject: Suppressing Data::Dumper warnings in test t/aggregate/live_component_controller_actio... X-Git-Tag: 5.90005~4^2~8^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=143cf217a4cb0172c6766c8e6ea1b3afaf43c285 Suppressing Data::Dumper warnings in test t/aggregate/live_component_controller_action_action.t --- diff --git a/t/lib/TestApp/View/Dump.pm b/t/lib/TestApp/View/Dump.pm index a59e417..6c4c1ec 100644 --- a/t/lib/TestApp/View/Dump.pm +++ b/t/lib/TestApp/View/Dump.pm @@ -7,13 +7,15 @@ use Data::Dumper (); use Scalar::Util qw(blessed weaken); sub dump { - my ( $self, $reference ) = @_; + my ( $self, $reference, $purity ) = @_; return unless $reference; + $purity = $purity // 1; + my $dumper = Data::Dumper->new( [$reference] ); $dumper->Indent(1); - $dumper->Purity(1); + $dumper->Purity($purity); $dumper->Useqq(0); $dumper->Deepcopy(1); $dumper->Quotekeys(0); @@ -23,7 +25,7 @@ sub dump { } sub process { - my ( $self, $c, $reference ) = @_; + my ( $self, $c, $reference, $purity ) = @_; # Force processing of on-demand data $c->prepare_body; @@ -37,7 +39,7 @@ sub process { my $context = delete $reference->{_context}; if ( my $output = - $self->dump( $reference ) ) + $self->dump( $reference, $purity ) ) { $c->res->headers->content_type('text/plain'); diff --git a/t/lib/TestApp/View/Dump/Action.pm b/t/lib/TestApp/View/Dump/Action.pm index a8c7a97..e15af5a 100644 --- a/t/lib/TestApp/View/Dump/Action.pm +++ b/t/lib/TestApp/View/Dump/Action.pm @@ -5,7 +5,7 @@ use base qw[TestApp::View::Dump]; sub process { my ( $self, $c ) = @_; - return $self->SUPER::process( $c, $c->action ); + return $self->SUPER::process( $c, $c->action, 0 ); } 1;