explicitly stringify IO::All objects when they are leaving the immediate scope, or...
[dbsrgits/DBIx-Class-Fixtures.git] / t / 14-populate-post.t
CommitLineData
f81264b2 1#!perl
2
3use DBIx::Class::Fixtures;
4use Test::More tests => 5;
5use lib qw(t/lib);
6use DBICTest;
7use Path::Class;
8use Data::Dumper;
9
10# set up and populate schema
11ok(my $schema = DBICTest->init_schema(), 'got schema');
12my $config_dir = 't/var/configs';
13
14# do dump
8a1df391 15ok(my $fixtures = DBIx::Class::Fixtures->new({
16 config_dir => $config_dir,
17 debug => 0 }),
18 'object created with correct config dir');
f81264b2 19
8a1df391 20ok($fixtures->dump({
21 config => "simple.json",
22 schema => $schema,
23 directory => 't/var/fixtures'
24 }),
25 "simple dump executed okay");
26
27$fixtures->populate({
28 ddl => 't/lib/sqlite.sql',
29 connection_details => ['dbi:SQLite:t/var/DBIxClass.db', '', ''],
30 directory => 't/var/fixtures',
31 post_ddl => 't/lib/post_sqlite.sql'
32});
f81264b2 33
8a1df391 34$schema = DBICTest->init_schema(no_deploy => 1);
35
36my $producer = $schema->resultset('Producer')->find(999999);
f81264b2 37isa_ok($producer, "DBICTest::Producer", "Got post-ddl producer");
8a1df391 38is($producer->name, "PostDDL", "Got producer name");
f81264b2 39