[Bast-commits] r5445 - DBIx-Class/0.08/branches/subquery/t/resultset
robkinyon at dev.catalyst.perl.org
robkinyon at dev.catalyst.perl.org
Tue Feb 10 22:53:48 GMT 2009
Author: robkinyon
Date: 2009-02-10 22:53:48 +0000 (Tue, 10 Feb 2009)
New Revision: 5445
Modified:
DBIx-Class/0.08/branches/subquery/t/resultset/as_query.t
Log:
Switched to use is_same_sql_bind() per ribasushi's suggestion
Modified: DBIx-Class/0.08/branches/subquery/t/resultset/as_query.t
===================================================================
--- DBIx-Class/0.08/branches/subquery/t/resultset/as_query.t 2009-02-10 21:41:58 UTC (rev 5444)
+++ DBIx-Class/0.08/branches/subquery/t/resultset/as_query.t 2009-02-10 22:53:48 UTC (rev 5445)
@@ -6,8 +6,9 @@
use Test::More;
use lib qw(t/lib);
use DBICTest;
+use DBIC::SqlMakerTest;
-plan tests => 8;
+plan tests => 4;
my $schema = DBICTest->init_schema();
my $art_rs = $schema->resultset('Artist');
@@ -16,8 +17,10 @@
my $arr = $art_rs->as_query;
my ($query, @bind) = @$arr;
- is( $query, "SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me" );
- is_deeply( \@bind, [] );
+ is_same_sql_bind(
+ $query, \@bind,
+ "SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me", [],
+ );
}
$art_rs = $art_rs->search({ name => 'Billy Joel' });
@@ -26,8 +29,11 @@
my $arr = $art_rs->as_query;
my ($query, @bind) = @$arr;
- is( $query, "SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me WHERE ( name = ? )" );
- is_deeply( \@bind, [ [ name => 'Billy Joel' ] ] );
+ is_same_sql_bind(
+ $query, \@bind,
+ "SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me WHERE ( name = ? )",
+ [ [ name => 'Billy Joel' ] ],
+ );
}
$art_rs = $art_rs->search({ rank => 2 });
@@ -36,8 +42,11 @@
my $arr = $art_rs->as_query;
my ($query, @bind) = @$arr;
- is( $query, "SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me WHERE ( ( ( rank = ? ) AND ( name = ? ) ) )" );
- is_deeply( \@bind, [ [ rank => 2 ], [ name => 'Billy Joel' ] ] );
+ is_same_sql_bind(
+ $query, \@bind,
+ "SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me WHERE ( ( ( rank = ? ) AND ( name = ? ) ) )",
+ [ [ rank => 2 ], [ name => 'Billy Joel' ] ],
+ );
}
my $rscol = $art_rs->get_column( 'charfield' );
@@ -46,8 +55,11 @@
my $arr = $rscol->as_query;
my ($query, @bind) = @$arr;
- is( $query, "SELECT me.charfield FROM artist me WHERE ( ( ( rank = ? ) AND ( name = ? ) ) )" );
- is_deeply( \@bind, [ [ rank => 2 ], [ name => 'Billy Joel' ] ] );
+ is_same_sql_bind(
+ $query, \@bind,
+ "SELECT me.charfield FROM artist me WHERE ( ( ( rank = ? ) AND ( name = ? ) ) )",
+ [ [ rank => 2 ], [ name => 'Billy Joel' ] ],
+ );
}
__END__
More information about the Bast-commits
mailing list