X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F95sql_maker.t;h=c4a65a29381a194f57f2bc98191ad9e221cc0239;hb=42a87bbbfd7e5d7a317f06c942edd5006d3e1428;hp=900e6048a30b3c569ceb407e4c0c37ab298f8785;hpb=89479564f69e12460c2740d1d74c6a1253af18cb;p=dbsrgits%2FDBIx-Class.git diff --git a/t/95sql_maker.t b/t/95sql_maker.t index 900e604..c4a65a2 100644 --- a/t/95sql_maker.t +++ b/t/95sql_maker.t @@ -2,17 +2,12 @@ use strict; use warnings; use Test::More; -use SQL::Abstract::Test import => ['is_same_sql_bind']; - - -BEGIN { - eval "use DBD::SQLite"; - plan $@ - ? ( skip_all => 'needs DBD::SQLite for testing' ) - : ( tests => 3 ); -} +use Test::Exception; use lib qw(t/lib); +use DBIC::SqlMakerTest; + +plan tests => 4; use_ok('DBICTest'); @@ -21,9 +16,7 @@ my $schema = DBICTest->init_schema(); my $sql_maker = $schema->storage->sql_maker; -SKIP: { - skip "SQL::Abstract < 1.50 does not pass through arrayrefs", 2 if $SQL::Abstract::VERSION < 1.50; - +{ my ($sql, @bind) = $sql_maker->insert( 'lottery', { @@ -55,3 +48,10 @@ SKIP: { 'sql_maker passes arrayrefs in update' ); } + +# Make sure the carp/croak override in SQLA works (via SQLAHacks) +my $file = __FILE__; +$file = "\Q$file\E"; +throws_ok (sub { + $schema->resultset ('Artist')->search ({}, { order_by => { -asc => 'stuff', -desc => 'staff' } } )->as_query; +}, qr/$file/, 'Exception correctly croak()ed');