From: Peter Rabbitson Date: Sat, 21 Apr 2012 01:32:04 +0000 (+0200) Subject: Saner naming for helper test method X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=13fa2937f8b3299a135f8c8878915098b2d8456c;p=dbsrgits%2FDBIx-Class-Historic.git Saner naming for helper test method --- diff --git a/t/73oracle.t b/t/73oracle.t index 01331b1..6433ce6 100644 --- a/t/73oracle.t +++ b/t/73oracle.t @@ -423,13 +423,12 @@ sub _run_tests { ); # test complex join (exercise orajoins) - lives_ok { - my @hri = $schema->resultset('CD')->search( + lives_ok { is_deeply ( + $schema->resultset('CD')->search( { 'artist.name' => 'pop_art_1', 'me.cdid' => { '!=', 999} }, { join => 'artist', prefetch => 'tracks', rows => 4, order_by => 'tracks.trackid' } - )->hri_dump->all; - - my $expect = [{ + )->all_hri, + [{ artist => 1, cdid => 1, genreid => undef, @@ -454,15 +453,9 @@ sub _run_tests { }, ], year => 2003 - }]; - - is_deeply ( - \@hri, - $expect, - 'Correct set of data prefetched', - ); - - } 'complex prefetch ok'; + }], + 'Correct set of data prefetched', + ) } 'complex prefetch ok'; # test sequence detection from a different schema SKIP: { diff --git a/t/lib/DBICTest/BaseResultSet.pm b/t/lib/DBICTest/BaseResultSet.pm index 6d9df85..f484dbf 100644 --- a/t/lib/DBICTest/BaseResultSet.pm +++ b/t/lib/DBICTest/BaseResultSet.pm @@ -6,8 +6,8 @@ use warnings; use base qw/DBIx::Class::ResultSet/; -sub hri_dump { - return shift->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' }); +sub all_hri { + return [ shift->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' })->all ]; } 1; diff --git a/t/prefetch/o2m_o2m_order_by_with_limit.t b/t/prefetch/o2m_o2m_order_by_with_limit.t index 1a91e42..f7f71e5 100644 --- a/t/prefetch/o2m_o2m_order_by_with_limit.t +++ b/t/prefetch/o2m_o2m_order_by_with_limit.t @@ -69,7 +69,7 @@ is_same_sql_bind( # cds belong to the second and third artist, respectively, and there's no sixth # row is_deeply ( - [ $filtered_cd_rs->hri_dump ], + $filtered_cd_rs->all_hri, [ { 'artist' => '2',