From: Peter Rabbitson Date: Wed, 2 Jun 2010 09:44:23 +0000 (+0000) Subject: lib expects a list, not an arrayref X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c4391f30e1dce6caf9f9037ff8b4e59fb23fb38;p=dbsrgits%2FDBIx-Class-Historic.git lib expects a list, not an arrayref --- diff --git a/script/dbicadmin b/script/dbicadmin index 6ab9d09..a6679e9 100755 --- a/script/dbicadmin +++ b/script/dbicadmin @@ -14,7 +14,6 @@ BEGIN { use DBIx::Class::Admin::Descriptive; #use Getopt::Long::Descriptive; use DBIx::Class::Admin; -require lib; my $short_description = "utility for administrating DBIx::Class schemata"; my $synopsis_text =q| @@ -90,11 +89,12 @@ if($opts->{selfinject_pod}) { # FIXME - lowercasing will eventually go away when Getopt::Long::Descriptive is fixed if($opts->{i}) { - lib->import(delete $opts->{i}); + require lib; + lib->import( @{delete $opts->{i}} ); } if($opts->{help}) { - $usage->die(); + $usage->die(); } # option compatability mangle diff --git a/t/admin/04include.t b/t/admin/04include.t deleted file mode 100644 index 6929193..0000000 --- a/t/admin/04include.t +++ /dev/null @@ -1,27 +0,0 @@ -use strict; -use warnings; - -use Test::More; -use Test::Exception; - -BEGIN { - require DBIx::Class; - plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin') - unless DBIx::Class::Optional::Dependencies->req_ok_for('admin'); -} - -if(use_ok 'DBIx::Class::Admin') { - my $admin = DBIx::Class::Admin->new( - include_dirs => ['t/lib/testinclude'], - schema_class => 'DBICTestAdminInc', - config => { DBICTestAdminInc => {} }, - config_stanza => 'DBICTestAdminInc' - ); - lives_ok { $admin->_build_schema } 'should survive attempt to load module located in include_dirs'; - { - no warnings 'once'; - ok($DBICTestAdminInc::loaded); - } -} - -done_testing; diff --git a/t/admin/10script.t b/t/admin/10script.t index 04d327c..5203565 100644 --- a/t/admin/10script.t +++ b/t/admin/10script.t @@ -21,8 +21,8 @@ plan tests => ($tests_per_run * @json_backends) + 1; # test the script is setting @INC properly -test_exec (qw| -It/lib/testinclude --schema=DBICTestAdminInc --op=deploy --connect=[] |); -cmp_ok ( $? >> 8, '==', 70, 'Correct exit code from deploying a custom INC schema' ); +test_exec (qw| -It/lib/testinclude --schema=DBICTestAdminInc --insert --connect=[] |); +cmp_ok ( $? >> 8, '==', 70, 'Correct exit code from connecting a custom INC schema' ); for my $js (@json_backends) { diff --git a/t/lib/testinclude/DBICTestAdminInc.pm b/t/lib/testinclude/DBICTestAdminInc.pm index a6d1e0e..cf7f6f9 100644 --- a/t/lib/testinclude/DBICTestAdminInc.pm +++ b/t/lib/testinclude/DBICTestAdminInc.pm @@ -1,9 +1,6 @@ package DBICTestAdminInc; use base 'DBIx::Class::Schema'; -our $loaded = 1; -sub connect { bless {}, __PACKAGE__ } - -sub deploy { exit 70 } # this is what the test will expect to see +sub connect { exit 70 } # this is what the test will expect to see 1;