Suppressing Data::Dumper warnings in test t/aggregate/live_component_controller_actio...
André Walker [Mon, 1 Aug 2011 23:28:18 +0000 (20:28 -0300)]
t/lib/TestApp/View/Dump.pm
t/lib/TestApp/View/Dump/Action.pm

index a59e417..6c4c1ec 100644 (file)
@@ -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');
index a8c7a97..e15af5a 100644 (file)
@@ -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;