From: Eden Cardim Date: Fri, 14 May 2010 02:03:21 +0000 (+0000) Subject: testing dbicadmin/DBIx::Class::Admin integration X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=578eee18878eb863685897a0d85cb6926408c5af;p=dbsrgits%2FDBIx-Class-Historic.git testing dbicadmin/DBIx::Class::Admin integration --- diff --git a/t/admin/10script.t b/t/admin/10script.t index 7718b34..633d797 100644 --- a/t/admin/10script.t +++ b/t/admin/10script.t @@ -16,7 +16,7 @@ BEGIN { } my @json_backends = qw/XS JSON DWIW/; -my $tests_per_run = 5; +my $tests_per_run = 6; plan tests => $tests_per_run * @json_backends; @@ -29,6 +29,11 @@ for my $js (@json_backends) { $ENV{JSON_ANY_ORDER} = $js; eval { test_dbicadmin () }; diag $@ if $@; + + # test the script is setting @INC properly + like(`script/dbicadmin -It/dbicadmin-test-include/lib --schema=Foo --op=deploy --connect=[] --debug`, + qr|Adding to \@INC:\nt/dbicadmin-test-include/lib| + ); } } diff --git a/t/dbicadmin-test-include/lib/Foo.pm b/t/dbicadmin-test-include/lib/Foo.pm index 2801e9e..1175c56 100644 --- a/t/dbicadmin-test-include/lib/Foo.pm +++ b/t/dbicadmin-test-include/lib/Foo.pm @@ -1,7 +1,9 @@ package Foo; +use base 'DBIx::Class::Schema'; our $loaded = 1; - -sub connect {} +our $deploy = 0; +sub connect { bless {}, 'Foo' } +sub deploy {$deploy = 1} 1;