Merge branch 'topic/parallelize-tests' of https://github.com/RsrchBoy/DBIx-Class...
John Napiorkowski [Tue, 21 Apr 2015 19:48:09 +0000 (14:48 -0500)]
1  2 
t/07-dump-all.t
t/lib/DBICTest.pm

diff --combined t/07-dump-all.t
@@@ -6,15 -6,18 +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 --combined t/lib/DBICTest.pm
@@@ -46,7 -46,11 +46,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} ) {
@@@ -152,11 -156,6 +156,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 ],