X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fadmin%2F02ddl.t;h=1d9ce882ff98b18df110ebcafecc629c9c1aacb1;hb=052a832c5f6fe0f82a4db48e176525f700c44159;hp=8b1c57fc2d2ca28ae56eda711c8181d333ba3cba;hpb=d830d9f4a137fa7ce6c14fe929a67951c4170b9e;p=dbsrgits%2FDBIx-Class.git diff --git a/t/admin/02ddl.t b/t/admin/02ddl.t index 8b1c57f..1d9ce88 100644 --- a/t/admin/02ddl.t +++ b/t/admin/02ddl.t @@ -9,6 +9,7 @@ use Path::Class; use lib qw(t/lib); use DBICTest; +use DBIx::Class::_Util 'sigwarn_silencer'; BEGIN { require DBIx::Class; @@ -48,7 +49,7 @@ isa_ok ($admin, 'DBIx::Class::Admin', 'create the admin object'); lives_ok { $admin->create('MySQL'); } 'Can create MySQL sql'; lives_ok { $admin->create('SQLite'); } 'Can Create SQLite sql'; lives_ok { - $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /no such table.+DROP TABLE/s }; + local $SIG{__WARN__} = sigwarn_silencer( qr/no such table.+DROP TABLE/s ); $admin->deploy() } 'Can Deploy schema'; } @@ -86,9 +87,9 @@ $admin = DBIx::Class::Admin->new( lives_ok { $admin->create($schema->storage->sqlt_type(), {}, "1.0" ); } 'Can create diff for ' . $schema->storage->sqlt_type; { - local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /DB version .+? is lower than the schema version/ }; - lives_ok {$admin->upgrade();} 'upgrade the schema'; - dies_ok {$admin->deploy} 'cannot deploy installed schema, should upgrade instead'; + local $SIG{__WARN__} = sigwarn_silencer( qr/DB version .+? is lower than the schema version/ ); + lives_ok { $admin->upgrade() } 'upgrade the schema'; + dies_ok { $admin->deploy } 'cannot deploy installed schema, should upgrade instead'; } is($schema->get_db_version, $DBICVersion::Schema::VERSION, 'Schema and db versions match');