Lose yet another dep (Data::Dumper::Concise)
[dbsrgits/DBIx-Class.git] / t / prefetch / attrs_untouched.t
index 53894b8..7b50344 100644 (file)
@@ -1,34 +1,27 @@
-use warnings;  
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
+use warnings;
+use strict;
 
 use Test::More;
-use Test::Exception;
-use lib qw(t/lib);
+
 use DBICTest;
-use Data::Dumper;
+use DBIx::Class::_Util 'dump_value';
 
 my $schema = DBICTest->init_schema();
 
-my $orig_debug = $schema->storage->debug;
-
-use IO::File;
-
-BEGIN {
-    eval "use DBD::SQLite";
-    plan $@
-        ? ( skip_all => 'needs DBD::SQLite for testing' )
-        : ( tests => 3 );
-}
+plan tests => 3;
 
 # bug in 0.07000 caused attr (join/prefetch) to be modifed by search
 # so we check the search & attr arrays are not modified
 my $search = { 'artist.name' => 'Caterwauler McCrae' };
 my $attr = { prefetch => [ qw/artist liner_notes/ ],
              order_by => 'me.cdid' };
-my $search_str = Dumper($search);
-my $attr_str = Dumper($attr);
+my $search_str = dump_value $search;
+my $attr_str = dump_value $attr;
 
 my $rs = $schema->resultset("CD")->search($search, $attr);
 
-is(Dumper($search), $search_str, 'Search hash untouched after search()');
-is(Dumper($attr), $attr_str, 'Attribute hash untouched after search()');
+is( dump_value $search, $search_str, 'Search hash untouched after search()');
+is( dump_value $attr, $attr_str, 'Attribute hash untouched after search()');
 cmp_ok($rs + 0, '==', 3, 'Correct number of records returned');