From: Aran Deltac Date: Thu, 18 May 2006 06:44:53 +0000 (+0000) Subject: Fixes to tests so that they pass. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=58d387fec14d2f92723ab0db1d64a18ee449639c;p=dbsrgits%2FDBIx-Class-Historic.git Fixes to tests so that they pass. --- diff --git a/t/19quotes.t b/t/19quotes.t index 7a85075..1275db1 100644 --- a/t/19quotes.t +++ b/t/19quotes.t @@ -1,4 +1,6 @@ use strict; +use warnings; + use Test::More; use IO::File; @@ -6,14 +8,13 @@ BEGIN { eval "use DBD::SQLite"; plan $@ ? ( skip_all => 'needs DBD::SQLite for testing' ) - : ( tests => 7 ); + : ( tests => 6 ); } use lib qw(t/lib); use_ok('DBICTest'); - -use_ok('DBICTest::HelperRels'); +DBICTest::init_schema(); DBICTest->schema->storage->sql_maker->quote_char("'"); DBICTest->schema->storage->sql_maker->name_sep('.'); diff --git a/t/31stats.t b/t/31stats.t index a478d28..b358ef0 100644 --- a/t/31stats.t +++ b/t/31stats.t @@ -8,13 +8,13 @@ BEGIN { eval "use DBD::SQLite"; plan $@ ? ( skip_all => 'needs DBD::SQLite for testing' ) - : ( tests => 13 ); + : ( tests => 12 ); } use lib qw(t/lib); use_ok('DBICTest'); -use_ok('DBICTest::HelperRels'); +DBICTest::init_schema(); my $cbworks = 0; diff --git a/t/745db2.t b/t/745db2.t index 36e5e8c..ffb7a0b 100644 --- a/t/745db2.t +++ b/t/745db2.t @@ -9,7 +9,7 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_DB2_${_}" } qw/DSN USER PASS/}; #warn "$dsn $user $pass"; -plan skip_all, 'Set $ENV{DBICTEST_DB2_DSN}, _USER and _PASS to run this test' +plan skip_all => 'Set $ENV{DBICTEST_DB2_DSN}, _USER and _PASS to run this test' unless ($dsn && $user); plan tests => 6; diff --git a/t/746db2_400.t b/t/746db2_400.t index 6c2344c..558ca62 100644 --- a/t/746db2_400.t +++ b/t/746db2_400.t @@ -12,7 +12,7 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_DB2_400_${_}" } qw/DSN USER PASS/ # Probably best to pass the DBQ option in the DSN to specify a specific # libray. Something like: # DBICTEST_DB2_400_DSN='dbi:ODBC:dsn=MyAS400;DBQ=MYLIB' -plan skip_all, 'Set $ENV{DBICTEST_DB2_400_DSN}, _USER and _PASS to run this test' +plan skip_all => 'Set $ENV{DBICTEST_DB2_400_DSN}, _USER and _PASS to run this test' unless ($dsn && $user); plan tests => 6; diff --git a/t/74mssql.t b/t/74mssql.t index f21d9e2..c879ca6 100644 --- a/t/74mssql.t +++ b/t/74mssql.t @@ -14,7 +14,7 @@ plan skip_all => 'Set $ENV{DBICTEST_MSSQL_DSN}, _USER and _PASS to run this test plan tests => 4; -$schema->compose_connection( 'MSSQLTest' => $dsn, $user, $pass ); +DBICTest::Schema->compose_connection( 'MSSQLTest' => $dsn, $user, $pass ); my $dbh = MSSQLTest->schema->storage->dbh; diff --git a/t/79uuid.t b/t/79uuid.t index d4800d9..04fcca6 100644 --- a/t/79uuid.t +++ b/t/79uuid.t @@ -8,7 +8,7 @@ use DBICTest; my $schema = DBICTest::init_schema(); eval 'use Data::UUID ; 1' - or plan skip_all, 'Install Data::UUID run this test'; + or plan skip_all => 'Install Data::UUID run this test'; plan tests => 1; DBICTest::Schema::Artist->load_components('UUIDColumns'); diff --git a/t/81transactions.t b/t/81transactions.t index fe3c453..c9d9c62 100644 --- a/t/81transactions.t +++ b/t/81transactions.t @@ -117,6 +117,7 @@ my $fail_code = sub { # Force txn_rollback() to throw an exception no warnings 'redefine'; + no strict 'refs'; local *{"DBIx::Class::Schema::txn_rollback"} = sub{die 'FAILED'}; eval { diff --git a/t/83cache.t b/t/83cache.t index a3c94c0..39f782a 100644 --- a/t/83cache.t +++ b/t/83cache.t @@ -40,7 +40,7 @@ $rs->set_cache( $artists ); is( scalar @{$rs->get_cache}, 2, 'set_cache() is functional' ); -$cd = $schema->resultset('CD')->find(1); +my $cd = $schema->resultset('CD')->find(1); $rs->clear_cache; diff --git a/t/86sqlt.t b/t/86sqlt.t index f457d55..eeb0ca9 100644 --- a/t/86sqlt.t +++ b/t/86sqlt.t @@ -10,7 +10,7 @@ plan skip_all => 'SQL::Translator required' if $@; # do not taunt happy dave ball -my $schema = DBICTest::Schema; +my $schema = 'DBICTest::Schema'; plan tests => 33; @@ -175,6 +175,8 @@ sub check_fk { return 0; } +my( $ondel, $onupd ); + sub check_unique { my ($selftable, $selfcol) = @_; diff --git a/t/87ordered.t b/t/87ordered.t index 7a4847e..1e4f33a 100644 --- a/t/87ordered.t +++ b/t/87ordered.t @@ -42,6 +42,7 @@ sub hammer_rs { my $employee; my $count = $rs->count(); my $position_column = $rs->result_class->position_column(); + my $row; foreach my $position (1..$count) { diff --git a/t/88result_set_column.t b/t/88result_set_column.t index e05dbb4..50ef1e6 100644 --- a/t/88result_set_column.t +++ b/t/88result_set_column.t @@ -9,6 +9,7 @@ my $schema = DBICTest::init_schema(); plan tests => 5; +my $cd; my $rs = $cd = $schema->resultset("CD")->search({}); my $rs_title = $rs->get_column('title'); diff --git a/t/cdbi-sweet-t/08pager.t b/t/cdbi-sweet-t/08pager.t index 9650315..e105932 100644 --- a/t/cdbi-sweet-t/08pager.t +++ b/t/cdbi-sweet-t/08pager.t @@ -15,7 +15,8 @@ BEGIN { use lib 't/lib'; -use_ok('DBICTest::HelperRels'); +use_ok('DBICTest'); +DBICTest::init_schema(); DBICTest::CD->load_components(qw/CDBICompat::Pager/);