X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F94versioning.t;h=a2e4007fcf8e7c5854b398929af2a126f9c9f576;hb=8dc59f2da55b17718ddc4f4a55e16496b9fdbde3;hp=2e0d18e7e8c3d60bc04b63aa7363128d752456a8;hpb=f54428abf9cc7d7e5604745335694eaf558f6820;p=dbsrgits%2FDBIx-Class.git diff --git a/t/94versioning.t b/t/94versioning.t index 2e0d18e..a2e4007 100644 --- a/t/94versioning.t +++ b/t/94versioning.t @@ -1,13 +1,17 @@ use strict; use warnings; + use Test::More; use Test::Warn; use Test::Exception; use Path::Class; use File::Copy; +use Time::HiRes qw/time sleep/; + +use lib qw(t/lib); +use DBICTest; # do not remove even though it is not used -#warn "$dsn $user $pass"; my ($dsn, $user, $pass); BEGIN { @@ -16,19 +20,12 @@ BEGIN { plan skip_all => 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test' unless ($dsn); - eval { require Time::HiRes } - || plan skip_all => 'Test needs Time::HiRes'; - Time::HiRes->import(qw/time sleep/); - require DBIx::Class; plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy') unless DBIx::Class::Optional::Dependencies->req_ok_for ('deploy') } -use lib qw(t/lib); -use DBICTest; # do not remove even though it is not used - use_ok('DBICVersion_v1'); my $version_table_name = 'dbix_class_schema_versions'; @@ -158,7 +155,7 @@ my $schema_v3 = DBICVersion::Schema->connect($dsn, $user, $pass, { ignore_versio # attempt v1 -> v3 upgrade { - local $SIG{__WARN__} = sub { warn if $_[0] !~ /Attempting upgrade\.$/ }; + local $SIG{__WARN__} = sub { warn $_[0] if $_[0] !~ /Attempting upgrade\.$/ }; $schema_v3->upgrade(); is($schema_v3->get_db_version(), '3.0', 'db version number upgraded'); } @@ -183,7 +180,7 @@ system( qq($^X -pi -e "s/ALTER/-- this is a comment\nALTER/" $fn->{trans_v23};) # Then attempt v1 -> v3 upgrade { - local $SIG{__WARN__} = sub { warn if $_[0] !~ /Attempting upgrade\.$/ }; + local $SIG{__WARN__} = sub { warn $_[0] if $_[0] !~ /Attempting upgrade\.$/ }; $schema_v3->upgrade(); is($schema_v3->get_db_version(), '3.0', 'db version number upgraded to 3.0'); @@ -237,7 +234,7 @@ system( qq($^X -pi -e "s/ALTER/-- this is a comment\nALTER/" $fn->{trans_v23};) $schema_v2->deploy; } - local $SIG{__WARN__} = sub { warn if $_[0] !~ /Attempting upgrade\.$/ }; + local $SIG{__WARN__} = sub { warn $_[0] if $_[0] !~ /Attempting upgrade\.$/ }; $schema_v2->upgrade(); is($schema_v2->get_db_version(), '3.0', 'Fast deploy/upgrade');