X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F18insert_default.t;h=17657cc660048c8a57c0e48f92c4bbc75364ba5a;hb=7e5a0e7c25474567b7f0b0daadba3f9b07297073;hp=c3f93693e54b697a72a4947998126de5414d6f57;hpb=7a72e5a5003eec9bf200b63a94f6f98d8e8d4ee4;p=dbsrgits%2FDBIx-Class.git diff --git a/t/18insert_default.t b/t/18insert_default.t index c3f9369..17657cc 100644 --- a/t/18insert_default.t +++ b/t/18insert_default.t @@ -5,27 +5,27 @@ use Test::More; use lib qw(t/lib); use DBICTest; -my $tests = 3; -plan tests => $tests; - my $schema = DBICTest->init_schema(); +$schema->storage->sql_maker->quote_char('"'); + my $rs = $schema->resultset ('Artist'); my $last_obj = $rs->search ({}, { order_by => { -desc => 'artistid' }, rows => 1})->single; my $last_id = $last_obj ? $last_obj->artistid : 0; my $obj; -eval { $obj = $rs->create ({}) }; -my $err = $@; +$schema->is_executed_sql_bind( sub { + $obj = $rs->create ({}) +}, [[ + 'INSERT INTO "artist" DEFAULT VALUES' +]], 'Default-value insert correct SQL' ); ok ($obj, 'Insert defaults ( $rs->create ({}) )' ); -SKIP: { - skip "Default insert failed: $err", $tests-1 if $err; - # this should be picked up without calling the DB again - is ($obj->artistid, $last_id + 1, 'Autoinc PK works'); +# this should be picked up without calling the DB again +is ($obj->artistid, $last_id + 1, 'Autoinc PK works'); - # for this we need to refresh - $obj->discard_changes; - is ($obj->rank, 13, 'Default value works'); -} +# for this we need to refresh +$obj->discard_changes; +is ($obj->rank, 13, 'Default value works'); +done_testing;