X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Fdeploy.t;fp=t%2Fstorage%2Fdeploy.t;h=eb317758c5f69b33a10b44e34cb678fc28d09c51;hb=e48635f7178f8527ec3cc230f1cf869e8876dc39;hp=64c2438e14feffd7576b321e899f7624f6bd2f88;hpb=aff5e9c14f7ad7453a4a2a7d04dc4e85fa0d661c;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/deploy.t b/t/storage/deploy.t index 64c2438..eb31775 100644 --- a/t/storage/deploy.t +++ b/t/storage/deploy.t @@ -6,10 +6,10 @@ use warnings; use Test::More; use Test::Exception; -use Path::Class qw/dir/; - use DBICTest; +use DBICTest::Util qw( slurp_bytes rm_rf ); +use DBIx::Class::_Util 'mkdir_p'; local $ENV{DBI_DSN}; @@ -29,11 +29,11 @@ lives_ok( sub { my $schema = DBICTest->init_schema( quote_names => 1 ); -my $var = dir ("t/var/ddl_dir-$$"); -$var->mkpath unless -d $var; +my $var_dir = "t/var/ddl_dir-$$/"; +mkdir_p $var_dir unless -d $var_dir; -my $test_dir_1 = $var->subdir ('test1', 'foo', 'bar' ); -$test_dir_1->rmtree if -d $test_dir_1; +my $test_dir_1 = $var_dir . 'test1/foo/bar'; +rm_rf $test_dir_1 if -d $test_dir_1; $schema->create_ddl_dir( [qw(SQLite MySQL)], 1, $test_dir_1 ); ok( -d $test_dir_1, 'create_ddl_dir did a make_path on its target dir' ); @@ -50,16 +50,24 @@ for ( my $type = $_->[0]; my $q = quotemeta($_->[1]); - for my $f (map { $test_dir_1->file("DBICTest-Schema-${_}-$type.sql") } qw(1 2) ) { - like scalar $f->slurp, qr/CREATE TABLE ${q}track${q}/, "Proper quoting in $f"; + for my $f (map { $test_dir_1 . "/DBICTest-Schema-${_}-$type.sql" } qw(1 2) ) { + like ( + scalar slurp_bytes $f, + qr/CREATE TABLE ${q}track${q}/, + "Proper quoting in $f" + ); } { local $TODO = 'SQLT::Producer::MySQL has no knowledge of the mythical beast of quoting...' if $type eq 'MySQL'; - my $f = $test_dir_1->file("DBICTest-Schema-1-2-$type.sql"); - like scalar $f->slurp, qr/DROP TABLE ${q}bindtype_test${q}/, "Proper quoting in diff $f"; + my $f = $test_dir_1 . "/DBICTest-Schema-1-2-$type.sql"; + like ( + scalar slurp_bytes $f, + qr/DROP TABLE ${q}bindtype_test${q}/, + "Proper quoting in diff $f" + ); } } @@ -69,7 +77,7 @@ for ( } END { - $var->rmtree; + rm_rf $var_dir; } done_testing;