From: Peter Rabbitson Date: Mon, 31 May 2010 16:47:34 +0000 (+0000) Subject: Some comments X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=099f10d17d95b08b12a9c88129c65b4bab0b60e2;p=dbsrgits%2FDBIx-Class-Historic.git Some comments --- diff --git a/script/dbicadmin b/script/dbicadmin index 3be43c2..cc24560 100755 --- a/script/dbicadmin +++ b/script/dbicadmin @@ -62,8 +62,7 @@ my ($opts, $usage) = describe_options( ['force' => 'Be forceful with some operations'], ['trace' => 'Turn on DBIx::Class trace output'], ['quiet' => 'Be less verbose'], - ['debug' => 'Print debug information'], - ['I:s@' => 'Same as perl\'s -I'], + ['I:s@' => 'Same as perl\'s -I, prepended to current @INC'], ) ); @@ -88,6 +87,7 @@ if($opts->{selfinject_pod}) { ); } +# FIXME - lowercasin will eventually go away when Getopt::Long::Descriptive is fixed if($opts->{i}) { $opts->{include_dirs} = delete $opts->{i}; } diff --git a/t/admin/10script.t b/t/admin/10script.t index 20e884b..04d327c 100644 --- a/t/admin/10script.t +++ b/t/admin/10script.t @@ -17,9 +17,13 @@ BEGIN { my @json_backends = qw/XS JSON DWIW/; my $tests_per_run = 5; - 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' ); + for my $js (@json_backends) { eval {JSON::Any->import ($js) }; @@ -29,14 +33,9 @@ for my $js (@json_backends) { $ENV{JSON_ANY_ORDER} = $js; eval { test_dbicadmin () }; diag $@ if $@; - } } -# 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' ); - sub test_dbicadmin { my $schema = DBICTest->init_schema( sqlite_use_file => 1 ); # reinit a fresh db for every run @@ -73,7 +72,7 @@ sub default_args { return ( qw|--quiet --schema=DBICTest::Schema --class=Employee|, q|--connect=["dbi:SQLite:dbname=t/var/DBIxClass.db","","",{"AutoCommit":1}]|, - qw|--force|, + qw|--force -I testincludenoniterference|, ); } diff --git a/t/lib/testinclude/DBICTestAdminInc.pm b/t/lib/testinclude/DBICTestAdminInc.pm index 111bfcd..a6d1e0e 100644 --- a/t/lib/testinclude/DBICTestAdminInc.pm +++ b/t/lib/testinclude/DBICTestAdminInc.pm @@ -4,6 +4,6 @@ use base 'DBIx::Class::Schema'; our $loaded = 1; sub connect { bless {}, __PACKAGE__ } -sub deploy { exit 70 } +sub deploy { exit 70 } # this is what the test will expect to see 1;