From: John Napiorkowski Date: Tue, 21 Apr 2015 20:01:46 +0000 (-0500) Subject: merged X-Git-Tag: v1.001_030~5^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4324011c0cde4807759bcbbf4d6b5b8478326e6;hp=c2a9b18b0ef6864d0bc75e5c52f05d2cc896f00f;p=dbsrgits%2FDBIx-Class-Fixtures.git merged --- diff --git a/.gitignore b/.gitignore index e442fbf..b5335c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .*.sw? \.DS_Store .prove +tmp/ local/ cpanfile cpanfile.snapshot diff --git a/Changes b/Changes index a171d46..c17ec7d 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,9 @@ Revision history for DBIx-Class-Fixtures {{$NEXT}} +- use Test::TempDir::Tiny for better test parallelization and cleanup + + 1.001_029 2015-01-14 15:17:28+00:00 Europe/London - fix for bugtracker pointing to gh, should be rt, added test to identify windows issues diff --git a/t/01-new.t b/t/01-new.t index 685a80b..8dd893a 100644 --- a/t/01-new.t +++ b/t/01-new.t @@ -2,8 +2,11 @@ use DBIx::Class::Fixtures; use Test::More tests => 3; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + my $config_dir = io->catfile(qw't var configs')->name; my $imaginary_config_dir = io->catfile(qw't var not_there')->name; diff --git a/t/02-dump-basic.t b/t/02-dump-basic.t index 0ab8119..ac13653 100644 --- a/t/02-dump-basic.t +++ b/t/02-dump-basic.t @@ -6,22 +6,25 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + use if $^O eq 'MSWin32','Devel::Confess'; # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; { # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); - ok($fixtures->dump({ config => 'simple.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'simple dump executed okay'); + ok($fixtures->dump({ config => 'simple.json', schema => $schema, directory => $tempdir }), 'simple dump executed okay'); # check dump is okay - my $dir = dir(io->catfile(qw't var fixtures artist')->name); - ok(-e io->catfile(qw't var fixtures artist')->name, 'artist directory created'); + my $dir = dir(io->catfile($tempdir, qw'artist')->name); + ok(-e io->catfile($tempdir, qw'artist')->name, 'artist directory created'); my @children = $dir->children; is(scalar(@children), 1, 'right number of fixtures created'); @@ -55,13 +58,13 @@ my $config_dir = io->catfile(qw't var configs')->name; "quantity" => 1 }] }, - schema => $schema, - directory => io->catfile(qw't var fixtures')->name, + schema => $schema, + directory => $tempdir, }), 'simple dump executed okay'); # check dump is okay - my $dir = dir(io->catfile(qw't var fixtures artist')->name); - ok(-e io->catfile(qw't var fixtures artist')->name, 'artist directory created'); + my $dir = dir(io->catfile($tempdir, qw'artist')->name); + ok(-e io->catfile($tempdir, qw'artist')->name, 'artist directory created'); my @children = $dir->children; is(scalar(@children), 1, 'right number of fixtures created'); diff --git a/t/03-dump-quantity.t b/t/03-dump-quantity.t index 5fba55b..cfad60b 100644 --- a/t/03-dump-quantity.t +++ b/t/03-dump-quantity.t @@ -6,18 +6,21 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; + +my $tempdir = tempdir; # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); -ok($fixtures->dump({ config => 'quantity.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'quantity dump executed okay'); +ok($fixtures->dump({ config => 'quantity.json', schema => $schema, directory => $tempdir }), 'quantity dump executed okay'); # check dump is okay -my $dir = dir(io->catfile(qw't var fixtures CD')->name); +my $dir = dir(io->catfile($tempdir, qw'CD')->name); my @children = $dir->children; is(scalar(@children), 3, 'right number of cd fixtures created'); diff --git a/t/04-dump-fetch.t b/t/04-dump-fetch.t index 0c21c60..c840df9 100644 --- a/t/04-dump-fetch.t +++ b/t/04-dump-fetch.t @@ -6,19 +6,22 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); -ok($fixtures->dump({ config => 'fetch.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'fetch dump executed okay'); +ok($fixtures->dump({ config => 'fetch.json', schema => $schema, directory => $tempdir }), 'fetch dump executed okay'); # check dump is okay -my $dir = dir(io->catfile(qw't var fixtures artist')->name); +my $dir = dir(io->catfile($tempdir, qw'artist')->name); my @children = $dir->children; is(scalar(@children), 3, 'right number of artist fixtures created'); @@ -32,7 +35,7 @@ foreach my $id (1, 2) { my $artist1 = $schema->resultset('Artist')->find(1); my @artist1_cds = $artist1->cds->all; foreach my $cd (@artist1_cds) { - my $cd_fix_file = dir(io->catfile(qw't var fixtures')->name, 'CD', $cd->id . '.fix'); + my $cd_fix_file = dir($tempdir, 'CD', $cd->id . '.fix'); ok(-e $cd_fix_file, "artist1's cd rel dumped okay"); } @@ -40,11 +43,11 @@ foreach my $cd (@artist1_cds) { my $artist2 = $schema->resultset('Artist')->find(2); my @artist2_cds = $artist2->cds->search({ year => { '>' => 2002 } }); foreach my $cd (@artist2_cds) { - my $cd_fix_file = dir(io->catfile(qw't var fixtures')->name, 'CD', $cd->id . '.fix'); + my $cd_fix_file = dir($tempdir, 'CD', $cd->id . '.fix'); ok(-e $cd_fix_file, "artist2's cd rel dumped okay"); } -my $cd_dir = dir(io->catfile(qw't var fixtures CD')->name); +my $cd_dir = dir(io->catfile($tempdir, qw'CD')->name); @children = $cd_dir->children; is(scalar(@children), scalar(@artist1_cds) + scalar(@artist2_cds), 'no extra cd fixtures dumped'); diff --git a/t/05-dump-rules.t b/t/05-dump-rules.t index 4b74df5..84443b9 100644 --- a/t/05-dump-rules.t +++ b/t/05-dump-rules.t @@ -6,19 +6,22 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); -ok($fixtures->dump({ config => 'rules.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'fetch dump executed okay'); +ok($fixtures->dump({ config => 'rules.json', schema => $schema, directory => $tempdir }), 'fetch dump executed okay'); # check dump is okay -my $dir = dir(io->catfile(qw't var fixtures')->name); +my $dir = dir($tempdir); my $cd_dir = dir($dir, 'CD'); my $track_dir = dir($dir, 'track'); diff --git a/t/06-dump-date.t b/t/06-dump-date.t index 63f47b7..efe1454 100644 --- a/t/06-dump-date.t +++ b/t/06-dump-date.t @@ -14,14 +14,14 @@ plan skip_all => 'Set $ENV{FIXTURETEST_DSN}, _USER and _PASS to point at MySQL D plan tests => 5; # set up and populate schema -ok(my $schema = DBICTest->init_schema( dsn => $ENV{FIXTURETEST_DSN}, user => $ENV{FIXTURETEST_USER}, pass => $ENV{FIXTURETEST_PASS}), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir, dsn => $ENV{FIXTURETEST_DSN}, user => $ENV{FIXTURETEST_USER}, pass => $ENV{FIXTURETEST_PASS}), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); -ok($fixtures->dump({ config => 'date.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'date dump executed okay'); -ok($fixtures->populate({ ddl => DBICTest->get_ddl_file($schema), connection_details => [$ENV{FIXTURETEST_DSN}, $ENV{FIXTURETEST_USER} || '', $ENV{FIXTURETEST_PASS} || ''], directory => io->catfile(qw't var fixtures')->name }), 'date populate okay'); +ok($fixtures->dump({ config => 'date.json', schema => $schema, directory => $tempdir }), 'date dump executed okay'); +ok($fixtures->populate({ ddl => DBICTest->get_ddl_file($schema), connection_details => [$ENV{FIXTURETEST_DSN}, $ENV{FIXTURETEST_USER} || '', $ENV{FIXTURETEST_PASS} || ''], directory => $tempdir }), 'date populate okay'); my $track = $schema->resultset('Track')->find(9); my $now = DateTime->now(); diff --git a/t/07-dump-all.t b/t/07-dump-all.t index 6a070c4..111bfd6 100644 --- a/t/07-dump-all.t +++ b/t/07-dump-all.t @@ -6,15 +6,18 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; + +my $tempdir = tempdir; use if $^O eq 'MSWin32','Devel::Confess'; -plan tests => 16; +plan tests => 18; # set up and populate schema -ok(my $schema = DBICTest->init_schema( ), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir, ), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; -my $fixture_dir = io->catfile(qw't var fixtures')->name; +my $fixture_dir = $tempdir; # do dump { diff --git a/t/08-dump-includes.t b/t/08-dump-includes.t index 169699c..d90ca73 100644 --- a/t/08-dump-includes.t +++ b/t/08-dump-includes.t @@ -6,25 +6,28 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); -ok($fixtures->dump({ config => 'includes.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'simple dump executed okay'); +ok($fixtures->dump({ config => 'includes.json', schema => $schema, directory => $tempdir }), 'simple dump executed okay'); # check dump is okay -my $producer_dir = dir(io->catfile(qw't var fixtures producer')->name); +my $producer_dir = dir(io->catfile($tempdir, qw'producer')->name); ok(-e $producer_dir, 'producer directory created'); my @producer_children = $producer_dir->children; is(scalar(@producer_children), 1, 'right number of fixtures created'); -my $artist_dir = dir(io->catfile(qw't var fixtures artist')->name); +my $artist_dir = dir(io->catfile($tempdir, qw'artist')->name); ok(-e $artist_dir, 'artist directory created'); my @artist_children = $artist_dir->children; diff --git a/t/09-dump-scalar-ref.t b/t/09-dump-scalar-ref.t index f540133..c18027b 100644 --- a/t/09-dump-scalar-ref.t +++ b/t/09-dump-scalar-ref.t @@ -6,21 +6,24 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); -ok($fixtures->dump({ config => 'scalar_ref.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'simple dump executed okay'); +ok($fixtures->dump({ config => 'scalar_ref.json', schema => $schema, directory => $tempdir }), 'simple dump executed okay'); { # check dump is okay - my $dir = dir(io->catfile(qw't var fixtures artist')->name); + my $dir = dir(io->catfile($tempdir, qw'artist')->name); my @children = $dir->children; is(scalar(@children), 1, 'right number of fixtures created'); @@ -32,7 +35,7 @@ ok($fixtures->dump({ config => 'scalar_ref.json', schema => $schema, directory = { # check dump is okay - my $dir = dir(io->catfile(qw't var fixtures CD')->name); + my $dir = dir(io->catfile($tempdir, qw'CD')->name); my @children = $dir->children; is(scalar(@children), 1, 'right number of fixtures created'); diff --git a/t/10-dump-cleanup.t b/t/10-dump-cleanup.t index 5cbf9b7..8b16efc 100644 --- a/t/10-dump-cleanup.t +++ b/t/10-dump-cleanup.t @@ -6,23 +6,26 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir }), 'object created with correct config dir'); -my $output_dir = dir(io->catfile(qw't var fixtures')->name); +my $output_dir = dir($tempdir); $output_dir->mkpath; my $file = file($output_dir, 'test_file'); my $fh = $file->open('w'); print $fh 'test file'; $fh->close; -ok($fixtures->dump({ config => 'simple.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'simple dump executed okay'); +ok($fixtures->dump({ config => 'simple.json', schema => $schema, directory => $tempdir }), 'simple dump executed okay'); ok(-e $file, 'file still exists'); diff --git a/t/12-populate-basic.t b/t/12-populate-basic.t index 66bdc6d..b8cb40b 100644 --- a/t/12-populate-basic.t +++ b/t/12-populate-basic.t @@ -6,10 +6,13 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump @@ -25,19 +28,19 @@ foreach my $set ('simple', 'quantity', 'fetch', 'rules') { DBICTest->populate_schema($schema); ok($fixtures->dump({ config => "$set.json", - schema => $schema, - directory => io->catfile(qw't var fixtures')->name + schema => $schema, + directory => $tempdir }), "$set dump executed okay" ); $fixtures->populate({ ddl => io->catfile(qw[t lib sqlite.sql])->name, - connection_details => ['dbi:SQLite:'.io->catfile(qw[ t var DBIxClass.db ])->name, '', ''], - directory => io->catfile(qw't var fixtures')->name + connection_details => ['dbi:SQLite:'.io->catfile($tempdir, qw[ DBIxClass.db ])->name, '', ''], + directory => $tempdir }); - $schema = DBICTest->init_schema( no_deploy => 1); + $schema = DBICTest->init_schema(db_dir => $tempdir, no_deploy => 1); - my $fixture_dir = dir(io->catfile(qw't var fixtures')->name); + my $fixture_dir = dir($tempdir); foreach my $class ($schema->sources) { my $source_dir = dir($fixture_dir, lc($class)); is($schema->resultset($class)->count, @@ -61,7 +64,7 @@ foreach my $set ('simple', 'quantity', 'fetch', 'rules') { } # use_create => 1 -$schema = DBICTest->init_schema(); +$schema = DBICTest->init_schema(db_dir => $tempdir); $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 @@ -69,32 +72,32 @@ $fixtures = DBIx::Class::Fixtures->new({ ok( $fixtures->dump({ config => "use_create.json", schema => $schema, - directory => io->catfile(qw't var fixtures')->name + directory => $tempdir }), "use_create dump executed okay" ); -$schema = DBICTest->init_schema( no_populate => 1 ); +$schema = DBICTest->init_schema(db_dir => $tempdir, no_populate => 1 ); $fixtures->populate({ - directory => io->catfile(qw't var fixtures')->name, - connection_details => ['dbi:SQLite:'.io->catfile(qw[ t var DBIxClass.db ])->name, '', ''], + directory => $tempdir, + connection_details => ['dbi:SQLite:'.io->catfile($tempdir, qw[ DBIxClass.db ])->name, '', ''], schema => $schema, no_deploy => 1, use_create => 1 }); -$schema = DBICTest->init_schema( no_deploy => 1, no_populate => 1 ); +$schema = DBICTest->init_schema(db_dir => $tempdir, no_deploy => 1, no_populate => 1 ); is( $schema->resultset( "Artist" )->find({ artistid => 4 })->name, "Test Name", "use_create => 1 ok" ); -$schema = DBICTest->init_schema( no_populate => 1 ); +$schema = DBICTest->init_schema(db_dir => $tempdir, no_populate => 1 ); $fixtures->populate({ - directory => io->catfile(qw't var fixtures')->name, - connection_details => ['dbi:SQLite:'.io->catfile(qw[ t var DBIxClass.db ])->name, '', ''], + directory => $tempdir, + connection_details => ['dbi:SQLite:'.io->catfile($tempdir, qw[ DBIxClass.db ])->name, '', ''], schema => $schema, no_deploy => 1, use_find_or_create => 1 }); is( $schema->resultset( "Artist" )->find({ artistid => 4 })->name, "Test Name", "use_find_or_create => 1 ok" ); $fixtures->populate({ - directory => io->catfile(qw't var fixtures')->name, - connection_details => ['dbi:SQLite:'.io->catfile(qw[ t var DBIxClass.db ])->name, '', ''], + directory => $tempdir, + connection_details => ['dbi:SQLite:'.io->catfile($tempdir, qw[ DBIxClass.db ])->name, '', ''], schema => $schema, no_deploy => 1, use_find_or_create => 1 diff --git a/t/13-populate-two-dbs.t b/t/13-populate-two-dbs.t index d05d51a..6fefbae 100644 --- a/t/13-populate-two-dbs.t +++ b/t/13-populate-two-dbs.t @@ -8,12 +8,15 @@ use Path::Class; use Data::Dumper; use DBICTest::Schema2; use Devel::Confess; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate normal schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; -my $dbix_class_different = io->catfile(qw[ t var DBIxClassDifferent.db ])->name; +my $dbix_class_different = io->catfile($tempdir, qw[ DBIxClassDifferent.db ])->name; my @different_connection_details = ( "dbi:SQLite:$dbix_class_different", '', @@ -38,24 +41,24 @@ ok(my $fixtures = DBIx::Class::Fixtures->new({ ok($fixtures->dump({ config => "simple.json", - schema => $schema, - directory => io->catfile(qw't var fixtures')->name + schema => $schema, + directory => $tempdir }), "simple dump executed okay"); ok($fixtures->populate({ ddl => io->catfile(qw[t lib sqlite_different.sql])->name, connection_details => [@different_connection_details], - directory => io->catfile(qw't var fixtures')->name + directory => $tempdir }), 'mysql populate okay'); ok($fixtures->populate({ ddl => io->catfile(qw[ t lib sqlite.sql ])->name, - connection_details => ['dbi:SQLite:'.io->catfile(qw[ t var DBIxClass.db ])->name, '', ''], - directory => io->catfile(qw't var fixtures')->name + connection_details => ['dbi:SQLite:'.io->catfile($tempdir, qw[ DBIxClass.db ])->name, '', ''], + directory => $tempdir }), 'sqlite populate okay'); -$schema = DBICTest->init_schema(no_deploy => 1); +$schema = DBICTest->init_schema(db_dir => $tempdir,no_deploy => 1); is($schema->resultset('Artist')->count, 1, 'artist imported to sqlite okay'); diff --git a/t/14-populate-post.t b/t/14-populate-post.t index 9bf6329..11f0893 100644 --- a/t/14-populate-post.t +++ b/t/14-populate-post.t @@ -6,10 +6,13 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump @@ -21,18 +24,18 @@ ok(my $fixtures = DBIx::Class::Fixtures->new({ ok($fixtures->dump({ config => "simple.json", schema => $schema, - directory => io->catfile(qw't var fixtures' )->name + directory => $tempdir, }), "simple dump executed okay"); $fixtures->populate({ ddl => io->catfile(qw't lib sqlite.sql')->name, - connection_details => ['dbi:SQLite:'.io->catfile(qw't var DBIxClass.db')->name, '', ''], - directory => io->catfile(qw't var fixtures')->name, + connection_details => ['dbi:SQLite:'.io->catfile($tempdir, 'DBIxClass.db')->name, '', ''], + directory => $tempdir, post_ddl => io->catfile(qw't lib post_sqlite.sql')->name }); -$schema = DBICTest->init_schema(no_deploy => 1); +$schema = DBICTest->init_schema(db_dir => $tempdir,no_deploy => 1); my $producer = $schema->resultset('Producer')->find(999999); isa_ok($producer, "DBICTest::Producer", "Got post-ddl producer"); diff --git a/t/15-multiple-belongs-to.t b/t/15-multiple-belongs-to.t index dea986f..58caa73 100644 --- a/t/15-multiple-belongs-to.t +++ b/t/15-multiple-belongs-to.t @@ -6,24 +6,27 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); -ok($fixtures->dump({ config => 'multiple-has-many.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'fetch dump executed okay'); +ok($fixtures->dump({ config => 'multiple-has-many.json', schema => $schema, directory => $tempdir }), 'fetch dump executed okay'); # check dump is okay -my $dir = dir(io->catfile(qw't var fixtures')->name); +my $dir = dir($tempdir); -ok( -e io->catfile(qw't var fixtures producer')->name, "We fetched some producers" ); -ok( -e io->catfile(qw't var fixtures cd_to_producer')->name, "We fetched some cd producer xrefs" ); -ok( -e io->catfile(qw't var fixtures CD')->name, "We fetched some cds" ); -ok( -e io->catfile(qw't var fixtures artist')->name, "We fetched some artists" ); +ok( -e io->catfile($tempdir, qw'producer')->name, "We fetched some producers" ); +ok( -e io->catfile($tempdir, qw'cd_to_producer')->name, "We fetched some cd producer xrefs" ); +ok( -e io->catfile($tempdir, qw'CD')->name, "We fetched some cds" ); +ok( -e io->catfile($tempdir, qw'artist')->name, "We fetched some artists" ); __END__ while ( my ($dirname, $sourcename) = each %dirs ) { diff --git a/t/16-rules-hasmany.t b/t/16-rules-hasmany.t index 82bf1d1..3f751a0 100644 --- a/t/16-rules-hasmany.t +++ b/t/16-rules-hasmany.t @@ -6,16 +6,19 @@ use lib qw(t/lib); use DBICTest; use Path::Class; use Data::Dumper; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + # set up and populate schema -ok(my $schema = DBICTest->init_schema(), 'got schema'); +ok(my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'); my $config_dir = io->catfile(qw't var configs')->name; # do dump ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); -ok($fixtures->dump({ config => 'rules2.json', schema => $schema, directory => io->catfile(qw't var fixtures')->name }), 'quantity dump executed okay'); +ok($fixtures->dump({ config => 'rules2.json', schema => $schema, directory => $tempdir }), 'quantity dump executed okay'); # check dump is okay foreach my $test ( @@ -23,7 +26,7 @@ foreach my $test ( [ 'CD', 2, 'CD', 'cdid' ], ) { my ($dirname, $count, $moniker, $id) = @$test; - my $dir = dir(io->catfile(qw"t var fixtures",$dirname)->name); + my $dir = dir(io->catfile($tempdir,$dirname)->name); my @children = $dir->children; is(scalar(@children), $count, "right number of $dirname fixtures created"); diff --git a/t/17-dump_all_config_sets.t b/t/17-dump_all_config_sets.t index be33234..f196858 100644 --- a/t/17-dump_all_config_sets.t +++ b/t/17-dump_all_config_sets.t @@ -6,10 +6,13 @@ use DBICTest; use Path::Class; use Data::Dumper; use File::Spec; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + ok my $config_dir = io->catfile(qw't var configs')->name; -ok my $schema = DBICTest->init_schema(), 'got schema'; +ok my $schema = DBICTest->init_schema(db_dir => $tempdir), 'got schema'; ok my $fixtures = DBIx::Class::Fixtures->new({config_dir => $config_dir}), 'object created with correct config dir'; @@ -19,14 +22,14 @@ my $ret = $fixtures->dump_config_sets({ schema => $schema, directory_template => sub { my ($fixture, $params, $set) = @_; - File::Spec->catdir('t','var','fixtures','multi', $set); + File::Spec->catdir($tempdir,'multi', $set); }, }); -ok -e io->catfile(qw't var fixtures multi date.json artist')->name, +ok -e io->catfile($tempdir, qw'multi date.json artist')->name, 'artist directory created'; -my $dir = dir(io->catfile(qw't var fixtures multi date.json artist')->name); +my $dir = dir(io->catfile($tempdir, qw'multi date.json artist')->name); my @children = $dir->children; is(scalar(@children), 1, 'right number of fixtures created'); diff --git a/t/18-extra.t b/t/18-extra.t index 90006e8..75528d5 100644 --- a/t/18-extra.t +++ b/t/18-extra.t @@ -4,8 +4,11 @@ use File::Path 'rmtree'; use lib qw(t/lib); use ExtraTest::Schema; +use Test::TempDir::Tiny; use IO::All; +my $tempdir = tempdir; + (my $schema = ExtraTest::Schema->connect( 'DBI:SQLite::memory:','',''))->init_schema; @@ -31,7 +34,7 @@ ok( $fixtures->dump({ config => 'extra.json', schema => $schema, - directory => io->catfile(qw"t var fixtures photos")->name }), + directory => io->catfile($tempdir, qw" photos")->name }), 'fetch dump executed okay'); ok my $key = $schema->resultset('Photo')->first->file; @@ -46,7 +49,7 @@ ok( $fixtures->populate({ no_deploy => 1, schema => $schema, - directory => io->catfile(qw"t var fixtures photos")->name}), + directory => io->catfile($tempdir, qw" photos")->name}), 'populated'); is $key, $schema->resultset('Photo')->first->file, @@ -58,5 +61,5 @@ done_testing; END { rmtree io->catfile(qw't var files')->name; - rmtree io->catfile(qw't var fixtures photos')->name; + rmtree io->catfile($tempdir, qw'photos')->name; } diff --git a/t/19-complex-hierarchy.t b/t/19-complex-hierarchy.t new file mode 100644 index 0000000..8fa5598 --- /dev/null +++ b/t/19-complex-hierarchy.t @@ -0,0 +1,49 @@ +#!perl + +use DBIx::Class::Fixtures; +use Test::More tests => 7; +use lib qw(t/lib); +use DBICTest; +use Path::Class; +use Data::Dumper; +use IO::All; + +use if $^O eq 'MSWin32','Devel::Confess'; +# set up and populate schema +ok(my $schema = DBICTest->init_schema(), 'got schema'); + +my $config_dir = io->catfile(qw't var configs')->name; + +# Add washedup + +ok my $artist = $schema->resultset("Artist")->find(1); +ok my $washed_up = $artist->create_related('washed_up', +{}); +ok $washed_up->fk_artistid; + + +ok(my $fixtures = DBIx::Class::Fixtures->new({ config_dir => $config_dir, debug => 0 }), 'object created with correct config dir'); +ok($fixtures->dump({ + config => { + "might_have" => { + "fetch" => 0 + }, + "has_many" => { + "fetch" => 0 + }, + "sets" => [{ + "class" => "Artist::WashedUp", + "quantity" => 1 + }] + }, + schema => $schema, + directory => io->catfile(qw't var fixtures')->name, + }), 'simple dump executed okay'); + +ok( + $fixtures->dump({ + config => 'washed-up.json', + schema => $schema, + directory => io->catfile(qw't var fixtures')->name, + })); + + diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 19f7398..c734874 100755 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -48,7 +48,11 @@ sub init_schema { my $self = shift; my %args = @_; - my $db_file = "t/var/DBIxClass.db"; + my $db_file + = $args{db_dir} + ? "$args{db_dir}/DBIxClass.db" + : "t/var/DBIxClass.db" + ; mkdir("t/var") unless -d "t/var"; if ( !$args{no_deploy} ) { @@ -154,6 +158,11 @@ sub populate_schema { [ 32948, 'Big PK' ], ]); + $schema->populate('Artist::WashedUp', [ + [ qw/fk_artistid/ ], + [ 2 ], + ]); + $schema->populate('CD', [ [ qw/cdid artist title year/ ], [ 1, 1, "Spoonful of bees", 1999 ], diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm index 350eecc..23e03d6 100644 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@ -5,6 +5,6 @@ use base qw/DBIx::Class::Schema/; no warnings qw/qw/; -__PACKAGE__->load_classes(qw/Artist CD Track Tag Producer CD_to_Producer/); +__PACKAGE__->load_classes(qw/Artist Artist::WashedUp CD Track Tag Producer CD_to_Producer/); 1; diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index f6d8180..3925cd6 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -22,6 +22,11 @@ __PACKAGE__->has_many( { order_by => 'year' }, ); +__PACKAGE__->might_have( + washed_up => 'DBICTest::Schema::Artist::WashedUp', + {'foreign.fk_artistid' => 'self.artistid'}, +); + sub new { my ( $class, $args ) = @_; diff --git a/t/lib/DBICTest/Schema/Artist/WashedUp.pm b/t/lib/DBICTest/Schema/Artist/WashedUp.pm new file mode 100644 index 0000000..998139f --- /dev/null +++ b/t/lib/DBICTest/Schema/Artist/WashedUp.pm @@ -0,0 +1,19 @@ +package # hide from PAUSE + DBICTest::Schema::Artist::WashedUp; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->table('artist_washed_up'); +__PACKAGE__->add_columns( + 'fk_artistid' => { + data_type => 'integer', + }, +); + +__PACKAGE__->set_primary_key('fk_artistid'); +__PACKAGE__->belongs_to( + 'artist', 'DBICTest::Schema::Artist', + { 'foreign.artistid' => 'self.fk_artistid' } +); + +1; diff --git a/t/lib/mysql.sql b/t/lib/mysql.sql index ca1b034..47bad04 100644 --- a/t/lib/mysql.sql +++ b/t/lib/mysql.sql @@ -17,6 +17,13 @@ CREATE TABLE artist ( name varchar(100) ); +-- +-- Table: artist_washed_up +-- +DROP TABLE IF EXISTS artist_washed_up; +CREATE TABLE artist_washed_up ( + fk_artistid INTEGER PRIMARY KEY NOT NULL +); -- -- Table: cd diff --git a/t/lib/sqlite.sql b/t/lib/sqlite.sql index 1e21627..f863b03 100644 --- a/t/lib/sqlite.sql +++ b/t/lib/sqlite.sql @@ -21,6 +21,12 @@ CREATE TABLE artist ( name varchar(100) ); +-- +-- Table: artist_washed_up +-- +CREATE TABLE artist_washed_up ( + fk_artistid INTEGER PRIMARY KEY NOT NULL +); -- -- Table: cd diff --git a/t/var/DBIxClass.db b/t/var/DBIxClass.db deleted file mode 100644 index 0341702..0000000 Binary files a/t/var/DBIxClass.db and /dev/null differ diff --git a/t/var/DBIxClassDifferent.db b/t/var/DBIxClassDifferent.db deleted file mode 100644 index 67aef5c..0000000 Binary files a/t/var/DBIxClassDifferent.db and /dev/null differ diff --git a/t/var/configs/washed-up.json b/t/var/configs/washed-up.json new file mode 100644 index 0000000..ffcdc50 --- /dev/null +++ b/t/var/configs/washed-up.json @@ -0,0 +1,18 @@ +{ + "might_have" : { + "fetch" : 0 + }, + "belongs_to" : { + "fetch" : 0 + }, + "sets" : [ + { + "class" : "Artist::WashedUp", + "quantity" : "all" + } + ], + "has_many" : { + "fetch" : 0 + } +} + diff --git a/t/var/fixtures/CD/1.fix b/t/var/fixtures/CD/1.fix deleted file mode 100644 index b7f372b..0000000 --- a/t/var/fixtures/CD/1.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 1, - cdid => 1, - title => 'Spoonful of bees', - year => 1999 - }; diff --git a/t/var/fixtures/CD/2.fix b/t/var/fixtures/CD/2.fix deleted file mode 100644 index a6b679a..0000000 --- a/t/var/fixtures/CD/2.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 1, - cdid => 2, - title => 'Forkful of bees', - year => 2001 - }; diff --git a/t/var/fixtures/CD/3.fix b/t/var/fixtures/CD/3.fix deleted file mode 100644 index 96c1068..0000000 --- a/t/var/fixtures/CD/3.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 1, - cdid => 3, - title => 'Caterwaulin\' Blues', - year => 1997 - }; diff --git a/t/var/fixtures/CD/4.fix b/t/var/fixtures/CD/4.fix deleted file mode 100644 index 26d5952..0000000 --- a/t/var/fixtures/CD/4.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 2, - cdid => 4, - title => 'Generic Manufactured Singles', - year => 2001 - }; diff --git a/t/var/fixtures/CD/5.fix b/t/var/fixtures/CD/5.fix deleted file mode 100644 index 0912382..0000000 --- a/t/var/fixtures/CD/5.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 2, - cdid => 5, - title => "Unicode Chars \x{2122} \251 \x{2022} \x{2020} \x{2211} \x{3b1} \x{3b2} \253 \273 \x{2192} \x{2026}", - year => 2015 - }; diff --git a/t/var/fixtures/CD/6.fix b/t/var/fixtures/CD/6.fix deleted file mode 100644 index 11a0d17..0000000 --- a/t/var/fixtures/CD/6.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 3, - cdid => 6, - title => "\334bertreibung \344lterer Umlaute", - year => 1998 - }; diff --git a/t/var/fixtures/_config_set b/t/var/fixtures/_config_set deleted file mode 100644 index 32a5aae..0000000 --- a/t/var/fixtures/_config_set +++ /dev/null @@ -1,17 +0,0 @@ -$VAR1 = { - 'sets' => [ - { - 'class' => 'CD', - 'quantity' => 'all' - } - ], - 'might_have' => { - 'fetch' => 0 - }, - 'has_many' => { - 'fetch' => 0 - }, - 'belongs_to' => { - 'fetch' => 1 - } - }; diff --git a/t/var/fixtures/_dumper_version b/t/var/fixtures/_dumper_version deleted file mode 100644 index 85690d1..0000000 --- a/t/var/fixtures/_dumper_version +++ /dev/null @@ -1 +0,0 @@ -1.001029 \ No newline at end of file diff --git a/t/var/fixtures/artist/1.fix b/t/var/fixtures/artist/1.fix deleted file mode 100644 index cd82bac..0000000 --- a/t/var/fixtures/artist/1.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 1, - name => 'Caterwauler McCrae' - }; diff --git a/t/var/fixtures/artist/2.fix b/t/var/fixtures/artist/2.fix deleted file mode 100644 index 997aaaf..0000000 --- a/t/var/fixtures/artist/2.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 2, - name => 'Random Boy Band' - }; diff --git a/t/var/fixtures/artist/3.fix b/t/var/fixtures/artist/3.fix deleted file mode 100644 index d117d39..0000000 --- a/t/var/fixtures/artist/3.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 3, - name => 'We Are Goth' - }; diff --git a/t/var/fixtures/excludes/CD/1.fix b/t/var/fixtures/excludes/CD/1.fix deleted file mode 100644 index b7f372b..0000000 --- a/t/var/fixtures/excludes/CD/1.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 1, - cdid => 1, - title => 'Spoonful of bees', - year => 1999 - }; diff --git a/t/var/fixtures/excludes/CD/2.fix b/t/var/fixtures/excludes/CD/2.fix deleted file mode 100644 index a6b679a..0000000 --- a/t/var/fixtures/excludes/CD/2.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 1, - cdid => 2, - title => 'Forkful of bees', - year => 2001 - }; diff --git a/t/var/fixtures/excludes/CD/3.fix b/t/var/fixtures/excludes/CD/3.fix deleted file mode 100644 index 96c1068..0000000 --- a/t/var/fixtures/excludes/CD/3.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 1, - cdid => 3, - title => 'Caterwaulin\' Blues', - year => 1997 - }; diff --git a/t/var/fixtures/excludes/CD/4.fix b/t/var/fixtures/excludes/CD/4.fix deleted file mode 100644 index 26d5952..0000000 --- a/t/var/fixtures/excludes/CD/4.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 2, - cdid => 4, - title => 'Generic Manufactured Singles', - year => 2001 - }; diff --git a/t/var/fixtures/excludes/CD/5.fix b/t/var/fixtures/excludes/CD/5.fix deleted file mode 100644 index 0912382..0000000 --- a/t/var/fixtures/excludes/CD/5.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 2, - cdid => 5, - title => "Unicode Chars \x{2122} \251 \x{2022} \x{2020} \x{2211} \x{3b1} \x{3b2} \253 \273 \x{2192} \x{2026}", - year => 2015 - }; diff --git a/t/var/fixtures/excludes/CD/6.fix b/t/var/fixtures/excludes/CD/6.fix deleted file mode 100644 index 11a0d17..0000000 --- a/t/var/fixtures/excludes/CD/6.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 3, - cdid => 6, - title => "\334bertreibung \344lterer Umlaute", - year => 1998 - }; diff --git a/t/var/fixtures/excludes/_config_set b/t/var/fixtures/excludes/_config_set deleted file mode 100644 index 00370ca..0000000 --- a/t/var/fixtures/excludes/_config_set +++ /dev/null @@ -1,33 +0,0 @@ -$VAR1 = { - 'sets' => [ - { - 'quantity' => 'all', - 'class' => 'Producer' - }, - { - 'quantity' => 'all', - 'class' => 'CD' - }, - { - 'quantity' => 'all', - 'class' => 'Artist' - }, - { - 'quantity' => 'all', - 'class' => 'Track' - }, - { - 'quantity' => 'all', - 'class' => 'CD_to_Producer' - } - ], - 'belongs_to' => { - 'fetch' => 0 - }, - 'has_many' => { - 'fetch' => 0 - }, - 'might_have' => { - 'fetch' => 0 - } - }; diff --git a/t/var/fixtures/excludes/_dumper_version b/t/var/fixtures/excludes/_dumper_version deleted file mode 100644 index 85690d1..0000000 --- a/t/var/fixtures/excludes/_dumper_version +++ /dev/null @@ -1 +0,0 @@ -1.001029 \ No newline at end of file diff --git a/t/var/fixtures/excludes/artist/1.fix b/t/var/fixtures/excludes/artist/1.fix deleted file mode 100644 index cd82bac..0000000 --- a/t/var/fixtures/excludes/artist/1.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 1, - name => 'Caterwauler McCrae' - }; diff --git a/t/var/fixtures/excludes/artist/2.fix b/t/var/fixtures/excludes/artist/2.fix deleted file mode 100644 index 997aaaf..0000000 --- a/t/var/fixtures/excludes/artist/2.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 2, - name => 'Random Boy Band' - }; diff --git a/t/var/fixtures/excludes/artist/3.fix b/t/var/fixtures/excludes/artist/3.fix deleted file mode 100644 index d117d39..0000000 --- a/t/var/fixtures/excludes/artist/3.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 3, - name => 'We Are Goth' - }; diff --git a/t/var/fixtures/excludes/artist/32948.fix b/t/var/fixtures/excludes/artist/32948.fix deleted file mode 100644 index f8f2fce..0000000 --- a/t/var/fixtures/excludes/artist/32948.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 32948, - name => 'Big PK' - }; diff --git a/t/var/fixtures/excludes/artist/4.fix b/t/var/fixtures/excludes/artist/4.fix deleted file mode 100644 index 479e5ea..0000000 --- a/t/var/fixtures/excludes/artist/4.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 4, - name => '' - }; diff --git a/t/var/fixtures/excludes/cd_to_producer/1-1.fix b/t/var/fixtures/excludes/cd_to_producer/1-1.fix deleted file mode 100644 index c08f3b2..0000000 --- a/t/var/fixtures/excludes/cd_to_producer/1-1.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - cd => 1, - producer => 1 - }; diff --git a/t/var/fixtures/excludes/cd_to_producer/1-2.fix b/t/var/fixtures/excludes/cd_to_producer/1-2.fix deleted file mode 100644 index 58f94f1..0000000 --- a/t/var/fixtures/excludes/cd_to_producer/1-2.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - cd => 1, - producer => 2 - }; diff --git a/t/var/fixtures/excludes/cd_to_producer/1-3.fix b/t/var/fixtures/excludes/cd_to_producer/1-3.fix deleted file mode 100644 index c9ed9a5..0000000 --- a/t/var/fixtures/excludes/cd_to_producer/1-3.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - cd => 1, - producer => 3 - }; diff --git a/t/var/fixtures/excludes/cd_to_producer/2-1.fix b/t/var/fixtures/excludes/cd_to_producer/2-1.fix deleted file mode 100644 index f19c713..0000000 --- a/t/var/fixtures/excludes/cd_to_producer/2-1.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - cd => 2, - producer => 1 - }; diff --git a/t/var/fixtures/excludes/cd_to_producer/2-2.fix b/t/var/fixtures/excludes/cd_to_producer/2-2.fix deleted file mode 100644 index 00981e1..0000000 --- a/t/var/fixtures/excludes/cd_to_producer/2-2.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - cd => 2, - producer => 2 - }; diff --git a/t/var/fixtures/excludes/cd_to_producer/3-3.fix b/t/var/fixtures/excludes/cd_to_producer/3-3.fix deleted file mode 100644 index fb5b464..0000000 --- a/t/var/fixtures/excludes/cd_to_producer/3-3.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - cd => 3, - producer => 3 - }; diff --git a/t/var/fixtures/excludes/producer/1.fix b/t/var/fixtures/excludes/producer/1.fix deleted file mode 100644 index a8964e1..0000000 --- a/t/var/fixtures/excludes/producer/1.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - name => 'Matt S Trout', - producerid => 1 - }; diff --git a/t/var/fixtures/excludes/producer/2.fix b/t/var/fixtures/excludes/producer/2.fix deleted file mode 100644 index a3b207b..0000000 --- a/t/var/fixtures/excludes/producer/2.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - name => 'Bob The Builder', - producerid => 2 - }; diff --git a/t/var/fixtures/excludes/producer/3.fix b/t/var/fixtures/excludes/producer/3.fix deleted file mode 100644 index b01cc0d..0000000 --- a/t/var/fixtures/excludes/producer/3.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - name => 'Fred The Phenotype', - producerid => 3 - }; diff --git a/t/var/fixtures/excludes/track/10.fix b/t/var/fixtures/excludes/track/10.fix deleted file mode 100644 index e6e9afd..0000000 --- a/t/var/fixtures/excludes/track/10.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 4, - last_updated_on - => undef, - position - => 1, - title => 'Boring Name', - trackid => 10 - }; diff --git a/t/var/fixtures/excludes/track/11.fix b/t/var/fixtures/excludes/track/11.fix deleted file mode 100644 index 5b19269..0000000 --- a/t/var/fixtures/excludes/track/11.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 4, - last_updated_on - => undef, - position - => 2, - title => 'Boring Song', - trackid => 11 - }; diff --git a/t/var/fixtures/excludes/track/12.fix b/t/var/fixtures/excludes/track/12.fix deleted file mode 100644 index 418ccdc..0000000 --- a/t/var/fixtures/excludes/track/12.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 4, - last_updated_on - => undef, - position - => 3, - title => 'No More Ideas', - trackid => 12 - }; diff --git a/t/var/fixtures/excludes/track/13.fix b/t/var/fixtures/excludes/track/13.fix deleted file mode 100644 index b42ba45..0000000 --- a/t/var/fixtures/excludes/track/13.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 5, - last_updated_on - => undef, - position - => 1, - title => 'Sad', - trackid => 13 - }; diff --git a/t/var/fixtures/excludes/track/14.fix b/t/var/fixtures/excludes/track/14.fix deleted file mode 100644 index 1fcd807..0000000 --- a/t/var/fixtures/excludes/track/14.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 5, - last_updated_on - => undef, - position - => 2, - title => 'Under The Weather', - trackid => 14 - }; diff --git a/t/var/fixtures/excludes/track/15.fix b/t/var/fixtures/excludes/track/15.fix deleted file mode 100644 index 8b82fd2..0000000 --- a/t/var/fixtures/excludes/track/15.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 5, - last_updated_on - => undef, - position - => 3, - title => 'Suicidal', - trackid => 15 - }; diff --git a/t/var/fixtures/excludes/track/16.fix b/t/var/fixtures/excludes/track/16.fix deleted file mode 100644 index 2f5d4aa..0000000 --- a/t/var/fixtures/excludes/track/16.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 1, - last_updated_on - => undef, - position - => 1, - title => 'The Bees Knees', - trackid => 16 - }; diff --git a/t/var/fixtures/excludes/track/17.fix b/t/var/fixtures/excludes/track/17.fix deleted file mode 100644 index d5accd5..0000000 --- a/t/var/fixtures/excludes/track/17.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 1, - last_updated_on - => undef, - position - => 2, - title => 'Apiary', - trackid => 17 - }; diff --git a/t/var/fixtures/excludes/track/18.fix b/t/var/fixtures/excludes/track/18.fix deleted file mode 100644 index abc8e4c..0000000 --- a/t/var/fixtures/excludes/track/18.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 1, - last_updated_on - => undef, - position - => 3, - title => 'Beehind You', - trackid => 18 - }; diff --git a/t/var/fixtures/excludes/track/4.fix b/t/var/fixtures/excludes/track/4.fix deleted file mode 100644 index 8699ddc..0000000 --- a/t/var/fixtures/excludes/track/4.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 2, - last_updated_on - => undef, - position - => 1, - title => 'Stung with Success', - trackid => 4 - }; diff --git a/t/var/fixtures/excludes/track/5.fix b/t/var/fixtures/excludes/track/5.fix deleted file mode 100644 index 1b8cdb4..0000000 --- a/t/var/fixtures/excludes/track/5.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 2, - last_updated_on - => undef, - position - => 2, - title => 'Stripy', - trackid => 5 - }; diff --git a/t/var/fixtures/excludes/track/6.fix b/t/var/fixtures/excludes/track/6.fix deleted file mode 100644 index 5ad6ff4..0000000 --- a/t/var/fixtures/excludes/track/6.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 2, - last_updated_on - => undef, - position - => 3, - title => 'Sticky Honey', - trackid => 6 - }; diff --git a/t/var/fixtures/excludes/track/7.fix b/t/var/fixtures/excludes/track/7.fix deleted file mode 100644 index 7d1ffd8..0000000 --- a/t/var/fixtures/excludes/track/7.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 3, - last_updated_on - => undef, - position - => 1, - title => 'Yowlin', - trackid => 7 - }; diff --git a/t/var/fixtures/excludes/track/8.fix b/t/var/fixtures/excludes/track/8.fix deleted file mode 100644 index 1e5a7fd..0000000 --- a/t/var/fixtures/excludes/track/8.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 3, - last_updated_on - => undef, - position - => 2, - title => 'Howlin', - trackid => 8 - }; diff --git a/t/var/fixtures/excludes/track/9.fix b/t/var/fixtures/excludes/track/9.fix deleted file mode 100644 index 3679235..0000000 --- a/t/var/fixtures/excludes/track/9.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 3, - last_updated_on - => '2007-10-20 00:00:00', - position - => 3, - title => 'Fowlin', - trackid => 9 - }; diff --git a/t/var/fixtures/multi/date.json/CD/3.fix b/t/var/fixtures/multi/date.json/CD/3.fix deleted file mode 100644 index 96c1068..0000000 --- a/t/var/fixtures/multi/date.json/CD/3.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 1, - cdid => 3, - title => 'Caterwaulin\' Blues', - year => 1997 - }; diff --git a/t/var/fixtures/multi/date.json/_config_set b/t/var/fixtures/multi/date.json/_config_set deleted file mode 100644 index 005a557..0000000 --- a/t/var/fixtures/multi/date.json/_config_set +++ /dev/null @@ -1,20 +0,0 @@ -$VAR1 = { - 'sets' => [ - { - 'class' => 'Track', - 'ids' => [ - '9' - ] - } - ], - 'belongs_to' => { - 'fetch' => 1 - }, - 'has_many' => { - 'fetch' => 0 - }, - 'might_have' => { - 'fetch' => 0 - }, - 'datetime_relative' => '2007-10-30 00:00:00' - }; diff --git a/t/var/fixtures/multi/date.json/_dumper_version b/t/var/fixtures/multi/date.json/_dumper_version deleted file mode 100644 index 85690d1..0000000 --- a/t/var/fixtures/multi/date.json/_dumper_version +++ /dev/null @@ -1 +0,0 @@ -1.001029 \ No newline at end of file diff --git a/t/var/fixtures/multi/date.json/artist/1.fix b/t/var/fixtures/multi/date.json/artist/1.fix deleted file mode 100644 index cd82bac..0000000 --- a/t/var/fixtures/multi/date.json/artist/1.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 1, - name => 'Caterwauler McCrae' - }; diff --git a/t/var/fixtures/multi/date.json/track/9.fix b/t/var/fixtures/multi/date.json/track/9.fix deleted file mode 100644 index f9c9e67..0000000 --- a/t/var/fixtures/multi/date.json/track/9.fix +++ /dev/null @@ -1,19 +0,0 @@ -$HASH1 = { - cd => 3, - last_updated_on - => { - days => -10, - end_of_month - => 'wrap', - minutes => 0, - months => 0, - nanoseconds - => 0, - seconds => 0 - }, - position - => 3, - title => 'Fowlin', - trackid => 9 - }; -bless( $HASH1->{last_updated_on}, 'DateTime::Duration' ); diff --git a/t/var/fixtures/multi/rules.json/CD/2.fix b/t/var/fixtures/multi/rules.json/CD/2.fix deleted file mode 100644 index a6b679a..0000000 --- a/t/var/fixtures/multi/rules.json/CD/2.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 1, - cdid => 2, - title => 'Forkful of bees', - year => 2001 - }; diff --git a/t/var/fixtures/multi/rules.json/CD/5.fix b/t/var/fixtures/multi/rules.json/CD/5.fix deleted file mode 100644 index 0912382..0000000 --- a/t/var/fixtures/multi/rules.json/CD/5.fix +++ /dev/null @@ -1,6 +0,0 @@ -$HASH1 = { - artist => 2, - cdid => 5, - title => "Unicode Chars \x{2122} \251 \x{2022} \x{2020} \x{2211} \x{3b1} \x{3b2} \253 \273 \x{2192} \x{2026}", - year => 2015 - }; diff --git a/t/var/fixtures/multi/rules.json/_config_set b/t/var/fixtures/multi/rules.json/_config_set deleted file mode 100644 index 2cc6621..0000000 --- a/t/var/fixtures/multi/rules.json/_config_set +++ /dev/null @@ -1,54 +0,0 @@ -$VAR1 = { - 'might_have' => { - 'fetch' => 0 - }, - 'rules' => { - 'might_have' => { - 'fetch' => 0 - }, - 'CD' => { - 'join' => [ - 'tags' - ], - 'fetch' => [ - { - 'cond' => { - 'position' => 2 - }, - 'rel' => 'tracks' - } - ], - 'cond' => [ - { - 'tags.tag' => 'Cheesy' - } - ] - } - }, - 'sets' => [ - { - 'ids' => [ - '5' - ], - 'class' => 'CD' - }, - { - 'ids' => [ - '1' - ], - 'fetch' => [ - { - 'rel' => 'cds', - 'quantity' => 'all' - } - ], - 'class' => 'Artist' - } - ], - 'belongs_to' => { - 'fetch' => 1 - }, - 'has_many' => { - 'fetch' => 0 - } - }; diff --git a/t/var/fixtures/multi/rules.json/_dumper_version b/t/var/fixtures/multi/rules.json/_dumper_version deleted file mode 100644 index 85690d1..0000000 --- a/t/var/fixtures/multi/rules.json/_dumper_version +++ /dev/null @@ -1 +0,0 @@ -1.001029 \ No newline at end of file diff --git a/t/var/fixtures/multi/rules.json/artist/1.fix b/t/var/fixtures/multi/rules.json/artist/1.fix deleted file mode 100644 index cd82bac..0000000 --- a/t/var/fixtures/multi/rules.json/artist/1.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 1, - name => 'Caterwauler McCrae' - }; diff --git a/t/var/fixtures/multi/rules.json/artist/2.fix b/t/var/fixtures/multi/rules.json/artist/2.fix deleted file mode 100644 index 997aaaf..0000000 --- a/t/var/fixtures/multi/rules.json/artist/2.fix +++ /dev/null @@ -1,4 +0,0 @@ -$HASH1 = { - artistid => 2, - name => 'Random Boy Band' - }; diff --git a/t/var/fixtures/multi/rules.json/track/14.fix b/t/var/fixtures/multi/rules.json/track/14.fix deleted file mode 100644 index 1fcd807..0000000 --- a/t/var/fixtures/multi/rules.json/track/14.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 5, - last_updated_on - => undef, - position - => 2, - title => 'Under The Weather', - trackid => 14 - }; diff --git a/t/var/fixtures/multi/rules.json/track/5.fix b/t/var/fixtures/multi/rules.json/track/5.fix deleted file mode 100644 index 1b8cdb4..0000000 --- a/t/var/fixtures/multi/rules.json/track/5.fix +++ /dev/null @@ -1,9 +0,0 @@ -$HASH1 = { - cd => 2, - last_updated_on - => undef, - position - => 2, - title => 'Stripy', - trackid => 5 - }; diff --git a/t/var/fixtures/test_file b/t/var/fixtures/test_file deleted file mode 100644 index bdf08de..0000000 --- a/t/var/fixtures/test_file +++ /dev/null @@ -1 +0,0 @@ -test file \ No newline at end of file