From: Rafael Kitover Date: Thu, 2 Aug 2012 14:22:18 +0000 (-0400) Subject: remove ->deploy from castaway's test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d59071409eb4fa2cf01736a2ee2f5607f75fed37;p=dbsrgits%2FDBIx-Class-Historic.git remove ->deploy from castaway's test --- diff --git a/t/lib/PrefetchBug/LeftRight.pm b/t/lib/PrefetchBug/LeftRight.pm index cf76ec0..8ac1362 100644 --- a/t/lib/PrefetchBug/LeftRight.pm +++ b/t/lib/PrefetchBug/LeftRight.pm @@ -6,7 +6,7 @@ use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->table('left_right'); +__PACKAGE__->table('prefetchbug_left_right'); __PACKAGE__->add_columns( left_id => { data_type => 'integer' }, right_id => { data_type => 'integer' }, diff --git a/t/lib/PrefetchBug/Right.pm b/t/lib/PrefetchBug/Right.pm index 3576bad..c99dea7 100644 --- a/t/lib/PrefetchBug/Right.pm +++ b/t/lib/PrefetchBug/Right.pm @@ -6,7 +6,7 @@ use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->table('prefetch_right'); +__PACKAGE__->table('prefetchbug_right'); __PACKAGE__->add_columns(qw/ id name category description propagates locked/); __PACKAGE__->set_primary_key('id'); diff --git a/t/prefetch/undef_prefetch_bug.t b/t/prefetch/undef_prefetch_bug.t index 8f9ee07..2304309 100644 --- a/t/prefetch/undef_prefetch_bug.t +++ b/t/prefetch/undef_prefetch_bug.t @@ -6,24 +6,39 @@ use lib qw(t/lib); use DBICTest; use PrefetchBug; -BEGIN { - 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'); -} - - my $schema - = PrefetchBug->connect( DBICTest->_database (quote_char => '"') ); - ok( $schema, 'Connected to PrefetchBug schema OK' ); - -#################### DEPLOY - - $schema->deploy( { add_drop_table => 1 } ); +my $schema = PrefetchBug->connect( DBICTest->_database (quote_char => '"') ); +ok( $schema, 'Connected to PrefetchBug schema OK' ); + +$schema->storage->dbh->do(<<"EOF"); +CREATE TABLE prefetchbug_left ( + id INTEGER PRIMARY KEY +) +EOF + +$schema->storage->dbh->do(<<"EOF"); +CREATE TABLE prefetchbug_right ( + id INTEGER PRIMARY KEY, + name TEXT, + category TEXT, + description TEXT, + propagates INT, + locked INT +) +EOF + +$schema->storage->dbh->do(<<"EOF"); +CREATE TABLE prefetchbug_left_right ( + left_id INTEGER REFERENCES prefetchbug_left(id), + right_id INTEGER REFERENCES prefetchbug_right(id), + value TEXT, + PRIMARY KEY (left_id, right_id) +) +EOF # Test simple has_many prefetch: my $leftc = $schema->resultset('Left')->create({}); + my $rightc = $schema->resultset('Right')->create({ id => 60, name => 'Johnny', category => 'something', description=> 'blah', propagates => 0, locked => 1 }); $rightc->create_related('prefetch_leftright', { left => $leftc, value => 'lr' });