From: Peter Rabbitson Date: Sun, 25 Jan 2009 10:09:41 +0000 (+0000) Subject: First stab at restructuring with tests_recursive() - no functional changes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=50891152d0b24649bfd67bdba97feec86b11c064;p=dbsrgits%2FDBIx-Class-Historic.git First stab at restructuring with tests_recursive() - no functional changes --- diff --git a/Makefile.PL b/Makefile.PL index 351dcaa..ab1aec3 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -37,7 +37,7 @@ test_requires 'Test::Deep' => 0; install_script 'script/dbicadmin'; -tests "t/*.t t/*/*.t"; +tests_recursive 't'; # re-build README and require CDBI modules for testing if we're in a checkout diff --git a/t/examples/Schema/MyDatabase/Main.pm b/examples/Schema/MyDatabase/Main.pm similarity index 100% rename from t/examples/Schema/MyDatabase/Main.pm rename to examples/Schema/MyDatabase/Main.pm diff --git a/t/examples/Schema/MyDatabase/Main/Result/Artist.pm b/examples/Schema/MyDatabase/Main/Result/Artist.pm similarity index 100% rename from t/examples/Schema/MyDatabase/Main/Result/Artist.pm rename to examples/Schema/MyDatabase/Main/Result/Artist.pm diff --git a/t/examples/Schema/MyDatabase/Main/Result/Cd.pm b/examples/Schema/MyDatabase/Main/Result/Cd.pm similarity index 100% rename from t/examples/Schema/MyDatabase/Main/Result/Cd.pm rename to examples/Schema/MyDatabase/Main/Result/Cd.pm diff --git a/t/examples/Schema/MyDatabase/Main/Result/Track.pm b/examples/Schema/MyDatabase/Main/Result/Track.pm similarity index 100% rename from t/examples/Schema/MyDatabase/Main/Result/Track.pm rename to examples/Schema/MyDatabase/Main/Result/Track.pm diff --git a/t/examples/Schema/db/example.sql b/examples/Schema/db/example.sql similarity index 100% rename from t/examples/Schema/db/example.sql rename to examples/Schema/db/example.sql diff --git a/t/examples/Schema/insertdb.pl b/examples/Schema/insertdb.pl similarity index 100% rename from t/examples/Schema/insertdb.pl rename to examples/Schema/insertdb.pl diff --git a/t/examples/Schema/testdb.pl b/examples/Schema/testdb.pl similarity index 100% rename from t/examples/Schema/testdb.pl rename to examples/Schema/testdb.pl diff --git a/t/cdbi-t/01-columns.t b/t/cdbi/01-columns.t similarity index 100% rename from t/cdbi-t/01-columns.t rename to t/cdbi/01-columns.t diff --git a/t/cdbi-t/02-Film.t b/t/cdbi/02-Film.t similarity index 99% rename from t/cdbi-t/02-Film.t rename to t/cdbi/02-Film.t index bd42d6e..988951d 100644 --- a/t/cdbi-t/02-Film.t +++ b/t/cdbi/02-Film.t @@ -13,7 +13,7 @@ BEGIN { } INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; use Film; } diff --git a/t/cdbi-t/03-subclassing.t b/t/cdbi/03-subclassing.t similarity index 97% rename from t/cdbi-t/03-subclassing.t rename to t/cdbi/03-subclassing.t index 9dc689b..1740de3 100644 --- a/t/cdbi-t/03-subclassing.t +++ b/t/cdbi/03-subclassing.t @@ -15,7 +15,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 6); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; INIT { @Film::Threat::ISA = qw/Film/; } diff --git a/t/cdbi-t/04-lazy.t b/t/cdbi/04-lazy.t similarity index 99% rename from t/cdbi-t/04-lazy.t rename to t/cdbi/04-lazy.t index 7b5a24c..bb1f288 100644 --- a/t/cdbi-t/04-lazy.t +++ b/t/cdbi/04-lazy.t @@ -19,7 +19,7 @@ BEGIN { } INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; use Lazy; } diff --git a/t/cdbi-t/06-hasa.t b/t/cdbi/06-hasa.t similarity index 99% rename from t/cdbi-t/06-hasa.t rename to t/cdbi/06-hasa.t index 56a1f86..cd27ab6 100644 --- a/t/cdbi-t/06-hasa.t +++ b/t/cdbi/06-hasa.t @@ -16,7 +16,7 @@ BEGIN { #local $SIG{__WARN__} = sub { }; INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; use Film; use Director; } diff --git a/t/cdbi-t/08-inheritcols.t b/t/cdbi/08-inheritcols.t similarity index 96% rename from t/cdbi-t/08-inheritcols.t rename to t/cdbi/08-inheritcols.t index af29424..83d1fee 100644 --- a/t/cdbi-t/08-inheritcols.t +++ b/t/cdbi/08-inheritcols.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; diff --git a/t/cdbi-t/09-has_many.t b/t/cdbi/09-has_many.t similarity index 99% rename from t/cdbi-t/09-has_many.t rename to t/cdbi/09-has_many.t index 28fa55e..0c1c845 100644 --- a/t/cdbi-t/09-has_many.t +++ b/t/cdbi/09-has_many.t @@ -10,7 +10,7 @@ BEGIN { } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; use Actor; Actor->has_a(Film => 'Film'); diff --git a/t/cdbi-t/11-triggers.t b/t/cdbi/11-triggers.t similarity index 98% rename from t/cdbi-t/11-triggers.t rename to t/cdbi/11-triggers.t index f25957c..efab875 100644 --- a/t/cdbi-t/11-triggers.t +++ b/t/cdbi/11-triggers.t @@ -11,7 +11,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 13); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; sub create_trigger2 { ::ok(1, "Running create trigger 2"); } diff --git a/t/cdbi-t/12-filter.t b/t/cdbi/12-filter.t similarity index 99% rename from t/cdbi-t/12-filter.t rename to t/cdbi/12-filter.t index 979ad56..e82b579 100644 --- a/t/cdbi-t/12-filter.t +++ b/t/cdbi/12-filter.t @@ -11,7 +11,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 50); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Actor; use Film; Film->has_many(actors => 'Actor'); diff --git a/t/cdbi-t/13-constraint.t b/t/cdbi/13-constraint.t similarity index 99% rename from t/cdbi-t/13-constraint.t rename to t/cdbi/13-constraint.t index 7f84161..7cdecb5 100644 --- a/t/cdbi-t/13-constraint.t +++ b/t/cdbi/13-constraint.t @@ -11,7 +11,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 23); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; sub valid_rating { diff --git a/t/cdbi-t/14-might_have.t b/t/cdbi/14-might_have.t similarity index 98% rename from t/cdbi-t/14-might_have.t rename to t/cdbi/14-might_have.t index febdd70..b309edc 100644 --- a/t/cdbi-t/14-might_have.t +++ b/t/cdbi/14-might_have.t @@ -11,7 +11,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 22); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; use Blurb; diff --git a/t/cdbi-t/15-accessor.t b/t/cdbi/15-accessor.t similarity index 99% rename from t/cdbi-t/15-accessor.t rename to t/cdbi/15-accessor.t index b487cc6..72f2c54 100644 --- a/t/cdbi-t/15-accessor.t +++ b/t/cdbi/15-accessor.t @@ -14,7 +14,7 @@ BEGIN { INIT { #local $SIG{__WARN__} = #sub { like $_[0], qr/clashes with built-in method/, $_[0] }; - use lib 't/testlib'; + use lib 't/cdbi/testlib'; require Film; require Actor; require Director; diff --git a/t/cdbi-t/16-reserved.t b/t/cdbi/16-reserved.t similarity index 96% rename from t/cdbi-t/16-reserved.t rename to t/cdbi/16-reserved.t index 2973ce1..67693a0 100644 --- a/t/cdbi-t/16-reserved.t +++ b/t/cdbi/16-reserved.t @@ -11,7 +11,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 5); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; require Film; require Order; diff --git a/t/cdbi-t/18-has_a.t b/t/cdbi/18-has_a.t similarity index 99% rename from t/cdbi-t/18-has_a.t rename to t/cdbi/18-has_a.t index ca7786e..e49c4d8 100644 --- a/t/cdbi-t/18-has_a.t +++ b/t/cdbi/18-has_a.t @@ -11,7 +11,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 41); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; use Director; @YA::Film::ISA = 'Film'; diff --git a/t/cdbi-t/19-set_sql.t b/t/cdbi/19-set_sql.t similarity index 99% rename from t/cdbi-t/19-set_sql.t rename to t/cdbi/19-set_sql.t index f725c89..eb464a3 100644 --- a/t/cdbi-t/19-set_sql.t +++ b/t/cdbi/19-set_sql.t @@ -11,7 +11,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 20); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; use Actor; diff --git a/t/cdbi-t/21-iterator.t b/t/cdbi/21-iterator.t similarity index 99% rename from t/cdbi-t/21-iterator.t rename to t/cdbi/21-iterator.t index d524423..c5717c7 100644 --- a/t/cdbi-t/21-iterator.t +++ b/t/cdbi/21-iterator.t @@ -11,7 +11,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 37); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; my $it_class = "DBIx::Class::ResultSet"; diff --git a/t/cdbi-t/22-deflate_order.t b/t/cdbi/22-deflate_order.t similarity index 93% rename from t/cdbi-t/22-deflate_order.t rename to t/cdbi/22-deflate_order.t index d813b19..9d943e5 100644 --- a/t/cdbi-t/22-deflate_order.t +++ b/t/cdbi/22-deflate_order.t @@ -12,7 +12,7 @@ if ($@) { eval { require Time::Piece::MySQL }; plan skip_all => "Need Time::Piece::MySQL for this test" if $@; -eval { require 't/testlib/Log.pm' }; +eval { require 't/cdbi/testlib/Log.pm' }; plan skip_all => "Need MySQL for this test" if $@; plan tests => 2; diff --git a/t/cdbi-t/22-self_referential.t b/t/cdbi/22-self_referential.t similarity index 92% rename from t/cdbi-t/22-self_referential.t rename to t/cdbi/22-self_referential.t index c937746..91fcb7f 100644 --- a/t/cdbi-t/22-self_referential.t +++ b/t/cdbi/22-self_referential.t @@ -1,25 +1,25 @@ -use Test::More; - -BEGIN { - eval "use DBIx::Class::CDBICompat;"; - plan $@ ? (skip_all => 'Class::Trigger and DBIx::ContextualFetch required') : (tests=> 2); -} - -use strict; - -use lib 't/testlib'; -use Actor; -use ActorAlias; -Actor->has_many( aliases => [ 'ActorAlias' => 'alias' ] ); - -my $first = Actor->create( { Name => 'First' } ); -my $second = Actor->create( { Name => 'Second' } ); - -ActorAlias->create( { actor => $first, alias => $second } ); - -my @aliases = $first->aliases; - -is( scalar @aliases, 1, 'proper number of aliases' ); -is( $aliases[ 0 ]->name, 'Second', 'proper alias' ); - - +use Test::More; + +BEGIN { + eval "use DBIx::Class::CDBICompat;"; + plan $@ ? (skip_all => 'Class::Trigger and DBIx::ContextualFetch required') : (tests=> 2); +} + +use strict; + +use lib 't/cdbi/testlib'; +use Actor; +use ActorAlias; +Actor->has_many( aliases => [ 'ActorAlias' => 'alias' ] ); + +my $first = Actor->create( { Name => 'First' } ); +my $second = Actor->create( { Name => 'Second' } ); + +ActorAlias->create( { actor => $first, alias => $second } ); + +my @aliases = $first->aliases; + +is( scalar @aliases, 1, 'proper number of aliases' ); +is( $aliases[ 0 ]->name, 'Second', 'proper alias' ); + + diff --git a/t/cdbi-t/23-cascade.t b/t/cdbi/23-cascade.t similarity index 98% rename from t/cdbi-t/23-cascade.t rename to t/cdbi/23-cascade.t index af8689b..a681882 100644 --- a/t/cdbi-t/23-cascade.t +++ b/t/cdbi/23-cascade.t @@ -13,7 +13,7 @@ BEGIN { } INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; use Film; use Director; } diff --git a/t/cdbi-t/24-meta_info.t b/t/cdbi/24-meta_info.t similarity index 98% rename from t/cdbi-t/24-meta_info.t rename to t/cdbi/24-meta_info.t index 2545111..7a269bd 100644 --- a/t/cdbi-t/24-meta_info.t +++ b/t/cdbi/24-meta_info.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; diff --git a/t/cdbi-t/26-mutator.t b/t/cdbi/26-mutator.t similarity index 96% rename from t/cdbi-t/26-mutator.t rename to t/cdbi/26-mutator.t index 1eeea25..5a1cf8f 100644 --- a/t/cdbi-t/26-mutator.t +++ b/t/cdbi/26-mutator.t @@ -14,7 +14,7 @@ BEGIN { : (tests => 6); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; require Film; sub Film::accessor_name_for { diff --git a/t/cdbi-t/30-pager.t b/t/cdbi/30-pager.t similarity index 93% rename from t/cdbi-t/30-pager.t rename to t/cdbi/30-pager.t index 31e43dc..2a90bfd 100644 --- a/t/cdbi-t/30-pager.t +++ b/t/cdbi/30-pager.t @@ -1,52 +1,52 @@ -use strict; -use Test::More; - -BEGIN { - eval "use DBIx::Class::CDBICompat;"; - if ($@) { - plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required'); - next; - } - eval "use DBD::SQLite"; - plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 6); -} - -use lib 't/testlib'; -use Film; - -my @film = ( - Film->create({ Title => 'Film 1' }), - Film->create({ Title => 'Film 2' }), - Film->create({ Title => 'Film 3' }), - Film->create({ Title => 'Film 4' }), - Film->create({ Title => 'Film 5' }), -); - -# first page -my ( $pager, $it ) = Film->page( - {}, - { rows => 3, - page => 1 } -); - -is( $pager->entries_on_this_page, 3, "entries_on_this_page ok" ); - -is( $pager->next_page, 2, "next_page ok" ); - -is( $it->next->title, "Film 1", "iterator->next ok" ); - -$it->next; -$it->next; - -is( $it->next, undef, "next past end of page ok" ); - -# second page -( $pager, $it ) = Film->page( - {}, - { rows => 3, - page => 2 } -); - -is( $pager->entries_on_this_page, 2, "entries on second page ok" ); - -is( $it->next->title, "Film 4", "second page first title ok" ); +use strict; +use Test::More; + +BEGIN { + eval "use DBIx::Class::CDBICompat;"; + if ($@) { + plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required'); + next; + } + eval "use DBD::SQLite"; + plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 6); +} + +use lib 't/cdbi/testlib'; +use Film; + +my @film = ( + Film->create({ Title => 'Film 1' }), + Film->create({ Title => 'Film 2' }), + Film->create({ Title => 'Film 3' }), + Film->create({ Title => 'Film 4' }), + Film->create({ Title => 'Film 5' }), +); + +# first page +my ( $pager, $it ) = Film->page( + {}, + { rows => 3, + page => 1 } +); + +is( $pager->entries_on_this_page, 3, "entries_on_this_page ok" ); + +is( $pager->next_page, 2, "next_page ok" ); + +is( $it->next->title, "Film 1", "iterator->next ok" ); + +$it->next; +$it->next; + +is( $it->next, undef, "next past end of page ok" ); + +# second page +( $pager, $it ) = Film->page( + {}, + { rows => 3, + page => 2 } +); + +is( $pager->entries_on_this_page, 2, "entries on second page ok" ); + +is( $it->next->title, "Film 4", "second page first title ok" ); diff --git a/t/cdbi-t/68-inflate_has_a.t b/t/cdbi/68-inflate_has_a.t similarity index 100% rename from t/cdbi-t/68-inflate_has_a.t rename to t/cdbi/68-inflate_has_a.t diff --git a/t/cdbi-t/98-failure.t b/t/cdbi/98-failure.t similarity index 98% rename from t/cdbi-t/98-failure.t rename to t/cdbi/98-failure.t index 4521b9a..9217342 100644 --- a/t/cdbi-t/98-failure.t +++ b/t/cdbi/98-failure.t @@ -15,7 +15,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 7); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; Film->create_test_film; diff --git a/t/cdbi-DeepAbstractSearch/01_search.t b/t/cdbi/DeepAbstractSearch/01_search.t similarity index 99% rename from t/cdbi-DeepAbstractSearch/01_search.t rename to t/cdbi/DeepAbstractSearch/01_search.t index 6826bb9..3db333e 100755 --- a/t/cdbi-DeepAbstractSearch/01_search.t +++ b/t/cdbi/DeepAbstractSearch/01_search.t @@ -17,7 +17,7 @@ BEGIN { plan tests => 19; } -my $DB = "t/testdb"; +my $DB = "t/var/cdbi_testdb"; unlink $DB if -e $DB; my @DSN = ("dbi:SQLite:dbname=$DB", '', '', { AutoCommit => 0 }); diff --git a/t/cdbi-abstract/search_where.t b/t/cdbi/abstract/search_where.t similarity index 98% rename from t/cdbi-abstract/search_where.t rename to t/cdbi/abstract/search_where.t index 3a89e3c..52595e2 100644 --- a/t/cdbi-abstract/search_where.t +++ b/t/cdbi/abstract/search_where.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use Test::More; use strict; @@ -16,7 +14,7 @@ BEGIN { } INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; use Film; } diff --git a/t/cdbi-t/columns_as_hashes.t b/t/cdbi/columns_as_hashes.t similarity index 98% rename from t/cdbi-t/columns_as_hashes.t rename to t/cdbi/columns_as_hashes.t index f85f50f..9ae1976 100644 --- a/t/cdbi-t/columns_as_hashes.t +++ b/t/cdbi/columns_as_hashes.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; use Test::Warn; @@ -10,7 +8,7 @@ BEGIN { : ('no_plan'); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; my $waves = Film->insert({ diff --git a/t/cdbi-t/columns_dont_override_custom_accessors.t b/t/cdbi/columns_dont_override_custom_accessors.t similarity index 97% rename from t/cdbi-t/columns_dont_override_custom_accessors.t rename to t/cdbi/columns_dont_override_custom_accessors.t index 4111b72..f9bd027 100644 --- a/t/cdbi-t/columns_dont_override_custom_accessors.t +++ b/t/cdbi/columns_dont_override_custom_accessors.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; diff --git a/t/cdbi-t/construct.t b/t/cdbi/construct.t similarity index 95% rename from t/cdbi-t/construct.t rename to t/cdbi/construct.t index e824b06..1ee7f14 100644 --- a/t/cdbi-t/construct.t +++ b/t/cdbi/construct.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; @@ -10,7 +8,7 @@ BEGIN { } INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; use Film; } diff --git a/t/cdbi-t/copy.t b/t/cdbi/copy.t similarity index 94% rename from t/cdbi-t/copy.t rename to t/cdbi/copy.t index cdcae15..25eb255 100644 --- a/t/cdbi-t/copy.t +++ b/t/cdbi/copy.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; @@ -10,7 +8,7 @@ BEGIN { } INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; } { diff --git a/t/cdbi-t/early_column_heisenbug.t b/t/cdbi/early_column_heisenbug.t similarity index 100% rename from t/cdbi-t/early_column_heisenbug.t rename to t/cdbi/early_column_heisenbug.t diff --git a/t/cdbi-t/has_many_loads_foreign_class.t b/t/cdbi/has_many_loads_foreign_class.t similarity index 96% rename from t/cdbi-t/has_many_loads_foreign_class.t rename to t/cdbi/has_many_loads_foreign_class.t index 9ab5c25..f6b30e7 100644 --- a/t/cdbi-t/has_many_loads_foreign_class.t +++ b/t/cdbi/has_many_loads_foreign_class.t @@ -10,7 +10,7 @@ BEGIN { } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Director; # Test that has_many() will load the foreign class. diff --git a/t/cdbi-t/hasa_without_loading.t b/t/cdbi/hasa_without_loading.t similarity index 95% rename from t/cdbi-t/hasa_without_loading.t rename to t/cdbi/hasa_without_loading.t index a6188c2..073ef3e 100644 --- a/t/cdbi-t/hasa_without_loading.t +++ b/t/cdbi/hasa_without_loading.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; diff --git a/t/cdbi-t/max_min_value_of.t b/t/cdbi/max_min_value_of.t similarity index 94% rename from t/cdbi-t/max_min_value_of.t rename to t/cdbi/max_min_value_of.t index f4a0bda..4b23608 100644 --- a/t/cdbi-t/max_min_value_of.t +++ b/t/cdbi/max_min_value_of.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; @@ -17,7 +15,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 2); } -use lib 't/testlib'; +use lib 't/cdbi/testlib'; use Film; Film->create({ diff --git a/t/cdbi-t/mk_group_accessors.t b/t/cdbi/mk_group_accessors.t similarity index 96% rename from t/cdbi-t/mk_group_accessors.t rename to t/cdbi/mk_group_accessors.t index 3a04ff5..7c5ce67 100644 --- a/t/cdbi-t/mk_group_accessors.t +++ b/t/cdbi/mk_group_accessors.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; @@ -14,7 +12,7 @@ BEGIN { } INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; require Film; } diff --git a/t/cdbi-t/multi_column_set.t b/t/cdbi/multi_column_set.t similarity index 96% rename from t/cdbi-t/multi_column_set.t rename to t/cdbi/multi_column_set.t index eb985e3..4311456 100644 --- a/t/cdbi-t/multi_column_set.t +++ b/t/cdbi/multi_column_set.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; diff --git a/t/cdbi-t/object_cache.t b/t/cdbi/object_cache.t similarity index 98% rename from t/cdbi-t/object_cache.t rename to t/cdbi/object_cache.t index 295bde6..896f8eb 100644 --- a/t/cdbi-t/object_cache.t +++ b/t/cdbi/object_cache.t @@ -13,7 +13,7 @@ BEGIN { } INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; use Film; } diff --git a/t/cdbi-t/retrieve_from_sql_with_limit.t b/t/cdbi/retrieve_from_sql_with_limit.t similarity index 93% rename from t/cdbi-t/retrieve_from_sql_with_limit.t rename to t/cdbi/retrieve_from_sql_with_limit.t index e0c452d..70a6128 100644 --- a/t/cdbi-t/retrieve_from_sql_with_limit.t +++ b/t/cdbi/retrieve_from_sql_with_limit.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; @@ -10,7 +8,7 @@ BEGIN { } INIT { - use lib 't/testlib'; + use lib 't/cdbi/testlib'; use Film; } diff --git a/t/cdbi-t/set_to_undef.t b/t/cdbi/set_to_undef.t similarity index 97% rename from t/cdbi-t/set_to_undef.t rename to t/cdbi/set_to_undef.t index 792c55e..83cf1a2 100644 --- a/t/cdbi-t/set_to_undef.t +++ b/t/cdbi/set_to_undef.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; diff --git a/t/cdbi-t/set_vs_DateTime.t b/t/cdbi/set_vs_DateTime.t similarity index 96% rename from t/cdbi-t/set_vs_DateTime.t rename to t/cdbi/set_vs_DateTime.t index fb76561..7dd17ce 100644 --- a/t/cdbi-t/set_vs_DateTime.t +++ b/t/cdbi/set_vs_DateTime.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl -w - use strict; use Test::More; use Test::Exception; diff --git a/t/cdbi-sweet-t/08pager.t b/t/cdbi/sweet/08pager.t similarity index 100% rename from t/cdbi-sweet-t/08pager.t rename to t/cdbi/sweet/08pager.t diff --git a/t/testlib/Actor.pm b/t/cdbi/testlib/Actor.pm similarity index 93% rename from t/testlib/Actor.pm rename to t/cdbi/testlib/Actor.pm index 1659be2..4e27abe 100644 --- a/t/testlib/Actor.pm +++ b/t/cdbi/testlib/Actor.pm @@ -1,8 +1,6 @@ package # hide from PAUSE Actor; -BEGIN { unshift @INC, './t/testlib'; } - use strict; use warnings; diff --git a/t/testlib/ActorAlias.pm b/t/cdbi/testlib/ActorAlias.pm similarity index 86% rename from t/testlib/ActorAlias.pm rename to t/cdbi/testlib/ActorAlias.pm index 90e3042..ba38551 100644 --- a/t/testlib/ActorAlias.pm +++ b/t/cdbi/testlib/ActorAlias.pm @@ -1,27 +1,25 @@ -package # hide from PAUSE - ActorAlias; - -BEGIN { unshift @INC, './t/testlib'; } - -use strict; -use warnings; - -use base 'DBIx::Class::Test::SQLite'; - -__PACKAGE__->set_table( 'ActorAlias' ); - -__PACKAGE__->columns( Primary => 'id' ); -__PACKAGE__->columns( All => qw/ actor alias / ); -__PACKAGE__->has_a( actor => 'Actor' ); -__PACKAGE__->has_a( alias => 'Actor' ); - -sub create_sql { - return qq{ - id INTEGER PRIMARY KEY, - actor INTEGER, - alias INTEGER - } -} - -1; - +package # hide from PAUSE + ActorAlias; + +use strict; +use warnings; + +use base 'DBIx::Class::Test::SQLite'; + +__PACKAGE__->set_table( 'ActorAlias' ); + +__PACKAGE__->columns( Primary => 'id' ); +__PACKAGE__->columns( All => qw/ actor alias / ); +__PACKAGE__->has_a( actor => 'Actor' ); +__PACKAGE__->has_a( alias => 'Actor' ); + +sub create_sql { + return qq{ + id INTEGER PRIMARY KEY, + actor INTEGER, + alias INTEGER + } +} + +1; + diff --git a/t/testlib/Binary.pm b/t/cdbi/testlib/Binary.pm similarity index 87% rename from t/testlib/Binary.pm rename to t/cdbi/testlib/Binary.pm index 10ba5b1..58d2bf4 100644 --- a/t/testlib/Binary.pm +++ b/t/cdbi/testlib/Binary.pm @@ -1,8 +1,6 @@ package # hide from PAUSE Binary; -BEGIN { unshift @INC, './t/testlib'; } - use strict; use base 'PgBase'; diff --git a/t/testlib/Blurb.pm b/t/cdbi/testlib/Blurb.pm similarity index 89% rename from t/testlib/Blurb.pm rename to t/cdbi/testlib/Blurb.pm index 4f4baf0..a112f47 100644 --- a/t/testlib/Blurb.pm +++ b/t/cdbi/testlib/Blurb.pm @@ -1,8 +1,6 @@ package # hide from PAUSE Blurb; -BEGIN { unshift @INC, './t/testlib'; } - use strict; use base 'DBIx::Class::Test::SQLite'; diff --git a/t/testlib/CDBase.pm b/t/cdbi/testlib/CDBase.pm similarity index 100% rename from t/testlib/CDBase.pm rename to t/cdbi/testlib/CDBase.pm diff --git a/t/testlib/Director.pm b/t/cdbi/testlib/Director.pm similarity index 89% rename from t/testlib/Director.pm rename to t/cdbi/testlib/Director.pm index b19a44a..af0a453 100644 --- a/t/testlib/Director.pm +++ b/t/cdbi/testlib/Director.pm @@ -1,8 +1,6 @@ package # hide from PAUSE Director; -BEGIN { unshift @INC, './t/testlib'; } - use strict; use base 'DBIx::Class::Test::SQLite'; diff --git a/t/testlib/Film.pm b/t/cdbi/testlib/Film.pm similarity index 95% rename from t/testlib/Film.pm rename to t/cdbi/testlib/Film.pm index 459015f..6521a59 100644 --- a/t/testlib/Film.pm +++ b/t/cdbi/testlib/Film.pm @@ -1,7 +1,6 @@ package # hide from PAUSE Film; -BEGIN { unshift @INC, './t/testlib'; } use base 'DBIx::Class::Test::SQLite'; use strict; diff --git a/t/testlib/Lazy.pm b/t/cdbi/testlib/Lazy.pm similarity index 92% rename from t/testlib/Lazy.pm rename to t/cdbi/testlib/Lazy.pm index b30c34b..2b2137e 100644 --- a/t/testlib/Lazy.pm +++ b/t/cdbi/testlib/Lazy.pm @@ -1,7 +1,6 @@ package # hide from PAUSE Lazy; -BEGIN { unshift @INC, './t/testlib'; } use base 'DBIx::Class::Test::SQLite'; use strict; diff --git a/t/testlib/Log.pm b/t/cdbi/testlib/Log.pm similarity index 94% rename from t/testlib/Log.pm rename to t/cdbi/testlib/Log.pm index 33672b5..b521e5e 100644 --- a/t/testlib/Log.pm +++ b/t/cdbi/testlib/Log.pm @@ -1,7 +1,6 @@ package # hide from PAUSE Log; -BEGIN { unshift @INC, './t/testlib'; } use base 'MyBase'; use strict; diff --git a/t/testlib/MyBase.pm b/t/cdbi/testlib/MyBase.pm similarity index 100% rename from t/testlib/MyBase.pm rename to t/cdbi/testlib/MyBase.pm diff --git a/t/testlib/MyFilm.pm b/t/cdbi/testlib/MyFilm.pm similarity index 91% rename from t/testlib/MyFilm.pm rename to t/cdbi/testlib/MyFilm.pm index e0abf44..d0ae5f8 100644 --- a/t/testlib/MyFilm.pm +++ b/t/cdbi/testlib/MyFilm.pm @@ -1,7 +1,6 @@ package # hide from PAUSE MyFilm; -BEGIN { unshift @INC, './t/testlib'; } use base 'MyBase'; use MyStarLink; diff --git a/t/testlib/MyFoo.pm b/t/cdbi/testlib/MyFoo.pm similarity index 93% rename from t/testlib/MyFoo.pm rename to t/cdbi/testlib/MyFoo.pm index d645d3d..dd387e2 100644 --- a/t/testlib/MyFoo.pm +++ b/t/cdbi/testlib/MyFoo.pm @@ -1,7 +1,6 @@ package # hide from PAUSE MyFoo; -BEGIN { unshift @INC, './t/testlib'; } use base 'MyBase'; use strict; diff --git a/t/testlib/MyStar.pm b/t/cdbi/testlib/MyStar.pm similarity index 90% rename from t/testlib/MyStar.pm rename to t/cdbi/testlib/MyStar.pm index f053d1c..22c1544 100644 --- a/t/testlib/MyStar.pm +++ b/t/cdbi/testlib/MyStar.pm @@ -1,7 +1,6 @@ package # hide from PAUSE MyStar; -BEGIN { unshift @INC, './t/testlib'; } use base 'MyBase'; use strict; diff --git a/t/testlib/MyStarLink.pm b/t/cdbi/testlib/MyStarLink.pm similarity index 90% rename from t/testlib/MyStarLink.pm rename to t/cdbi/testlib/MyStarLink.pm index 74a835c..143c2f4 100644 --- a/t/testlib/MyStarLink.pm +++ b/t/cdbi/testlib/MyStarLink.pm @@ -1,7 +1,6 @@ package # hide from PAUSE MyStarLink; -BEGIN { unshift @INC, './t/testlib'; } use base 'MyBase'; use strict; diff --git a/t/testlib/MyStarLinkMCPK.pm b/t/cdbi/testlib/MyStarLinkMCPK.pm similarity index 93% rename from t/testlib/MyStarLinkMCPK.pm rename to t/cdbi/testlib/MyStarLinkMCPK.pm index 3e74a5b..dfc3ff2 100644 --- a/t/testlib/MyStarLinkMCPK.pm +++ b/t/cdbi/testlib/MyStarLinkMCPK.pm @@ -1,7 +1,6 @@ package # hide from PAUSE MyStarLinkMCPK; -BEGIN { unshift @INC, './t/testlib'; } use base 'MyBase'; use MyStar; diff --git a/t/testlib/Order.pm b/t/cdbi/testlib/Order.pm similarity index 89% rename from t/testlib/Order.pm rename to t/cdbi/testlib/Order.pm index 009e10e..703005d 100644 --- a/t/testlib/Order.pm +++ b/t/cdbi/testlib/Order.pm @@ -1,8 +1,6 @@ package # hide from PAUSE Order; -BEGIN { unshift @INC, './t/testlib'; } - use strict; use base 'DBIx::Class::Test::SQLite'; diff --git a/t/testlib/OtherFilm.pm b/t/cdbi/testlib/OtherFilm.pm similarity index 100% rename from t/testlib/OtherFilm.pm rename to t/cdbi/testlib/OtherFilm.pm diff --git a/t/testlib/OtherThing.pm b/t/cdbi/testlib/OtherThing.pm similarity index 100% rename from t/testlib/OtherThing.pm rename to t/cdbi/testlib/OtherThing.pm diff --git a/t/testlib/PgBase.pm b/t/cdbi/testlib/PgBase.pm similarity index 100% rename from t/testlib/PgBase.pm rename to t/cdbi/testlib/PgBase.pm diff --git a/t/testlib/Thing.pm b/t/cdbi/testlib/Thing.pm similarity index 100% rename from t/testlib/Thing.pm rename to t/cdbi/testlib/Thing.pm