From: Will Hawes Date: Wed, 28 Sep 2011 12:50:39 +0000 (+0100) Subject: make dump/populate work with mixed case table names X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70bef9ffda2e197ebf45c7c82f651f7fc43f6225;p=dbsrgits%2FDBIx-Class-Fixtures.git make dump/populate work with mixed case table names --- diff --git a/t/18-dump-mixed-case.t b/t/18-dump-mixed-case.t new file mode 100644 index 0000000..5deacbb --- /dev/null +++ b/t/18-dump-mixed-case.t @@ -0,0 +1,23 @@ +#!perl + +use DBIx::Class::Fixtures; +use Test::More tests => 3; +use lib qw(t/lib); +use DBICTest; +use Path::Class; +use Data::Dumper; + +# set up and populate schema +ok(my $schema = DBICTest->init_schema(), 'got schema'); + +my $config_dir = 't/var/configs'; + +{ + # 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 => 't/var/fixtures' }), 'simple dump executed okay'); + + # check dump is okay + my $dir = dir('t/var/fixtures/MixedCase'); + ok(-e 't/var/fixtures/MixedCase', 'MixedCase directory created'); +} diff --git a/t/lib/DBICTest/Schema/MixedCase.pm b/t/lib/DBICTest/Schema/MixedCase.pm new file mode 100644 index 0000000..9aa1357 --- /dev/null +++ b/t/lib/DBICTest/Schema/MixedCase.pm @@ -0,0 +1,20 @@ +package # hide from PAUSE + DBICTest::Schema::MixedCase; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->table('MixedCase'); +__PACKAGE__->add_columns( + 'id' => { + data_type => 'integer', + is_auto_increment => 1, + }, + 'name' => { + data_type => 'varchar', + size => 100, + is_nullable => 1, + }, +); +__PACKAGE__->set_primary_key('id'); + +1; diff --git a/t/var/configs/mixed-case.json b/t/var/configs/mixed-case.json new file mode 100644 index 0000000..5a49395 --- /dev/null +++ b/t/var/configs/mixed-case.json @@ -0,0 +1,6 @@ +{ + "sets": [{ + "class": "MixedCase", + "quantity": 1 + }] +}