X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F86sqlt.t;h=eccc5e245c6ec6e3906136094db2c9c3d6834419;hb=d4702d539ce9d9d19868a0709576264c3b72afdd;hp=caea89fb254665dbedc72c8b61de404fc64ca0bb;hpb=f9b5239ac2e308ac231d4a17351e3465a285e7fa;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/86sqlt.t b/t/86sqlt.t index caea89f..eccc5e2 100644 --- a/t/86sqlt.t +++ b/t/86sqlt.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use Test::Warn; use lib qw(t/lib); use DBICTest; @@ -25,7 +26,7 @@ sub DBICTest::Schema::deployment_statements { # Check deployment statements ctx sensitivity { - my $schema = DBICTest->init_schema (no_deploy => 1); + my $schema = DBICTest->init_schema (no_deploy => 1, quote_names => 1); my $not_first_table_creation_re = qr/CREATE TABLE "fourkeys_to_twokeys"/; my $statements = $schema->deployment_statements; @@ -118,19 +119,15 @@ my $schema = DBICTest->init_schema (no_deploy => 1); my $translator = SQL::Translator->new( parser_args => { - 'DBIx::Schema' => $schema, + dbic_schema => $schema, }, producer_args => {}, ); -{ - my $warn = ''; - local $SIG{__WARN__} = sub { $warn = shift }; - +warnings_exist { my $relinfo = $schema->source('Artist')->relationship_info ('cds'); local $relinfo->{attrs}{on_delete} = 'restrict'; - $translator->parser('SQL::Translator::Parser::DBIx::Class'); $translator->producer('SQLite'); @@ -139,13 +136,9 @@ my $translator = SQL::Translator->new( ok($output, "SQLT produced someoutput") or diag($translator->error); - - like ( - $warn, - qr/SQLT attribute .+? was supplied for relationship .+? which does not appear to be a foreign constraint/, - 'Warn about dubious on_delete/on_update attributes', - ); -} +} [ + (qr/SQLT attribute .+? was supplied for relationship .+? which does not appear to be a foreign constraint/) x 2 +], 'Warn about dubious on_delete/on_update attributes'; # Note that the constraints listed here are the only ones that are tested -- if # more exist in the Schema than are listed here and all listed constraints are