From: Rafael Kitover Date: Mon, 24 Aug 2009 15:39:56 +0000 (+0000) Subject: finished cleaning up branch, all tests pass X-Git-Tag: 0.04999_08~2^2~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7cb9244f9742355f71a24efa0d6d4c076c8a5bf3;p=dbsrgits%2FDBIx-Class-Schema-Loader.git finished cleaning up branch, all tests pass --- diff --git a/t/15sybase_common.t b/t/15sybase_common.t index bce97e1..41f0e35 100644 --- a/t/15sybase_common.t +++ b/t/15sybase_common.t @@ -9,11 +9,14 @@ my $user = $ENV{DBICTEST_SYBASE_USER} || ''; my $password = $ENV{DBICTEST_SYBASE_PASS} || ''; my $tester = dbixcsl_common_tests->new( - vendor => 'Sybase', + vendor => 'sybase', auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY', dsn => $dsn, user => $user, password => $password, +# This is necessary because there are too many cursors open for transactions on +# insert to work. + connect_info_opts => { on_connect_call => 'unsafe_insert' } ); if( !$dsn || !$user ) { diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index 159d4e5..bd5ae52 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -58,7 +58,12 @@ sub run_tests { $self->create(); - my @connect_info = ( $self->{dsn}, $self->{user}, $self->{password} ); + my @connect_info = ( + $self->{dsn}, + $self->{user}, + $self->{password}, + $self->{connect_info_opts}, + ); # First, with in-memory classes my $schema_class = $self->setup_schema(@connect_info); diff --git a/t/lib/dbixcsl_mssql_extra_tests.pm b/t/lib/dbixcsl_mssql_extra_tests.pm index 587d77d..bf178d7 100644 --- a/t/lib/dbixcsl_mssql_extra_tests.pm +++ b/t/lib/dbixcsl_mssql_extra_tests.pm @@ -2,21 +2,31 @@ package dbixcsl_mssql_extra_tests; use Test::More; +my $vendor = 'mssql'; + +sub vendor { + shift; + $vendor = shift; +} + sub extra { +{ create => [ qq{ - CREATE TABLE [mssql_loader_test1.dot] ( + CREATE TABLE [${vendor}_loader_test1.dot] ( id INT IDENTITY NOT NULL PRIMARY KEY, dat VARCHAR(8) ) }, ], - drop => [ qw/ [mssql_loader_test1.dot] / ], + drop => [ "[${vendor}_loader_test1.dot]" ], count => 4, run => sub { my ($schema, $monikers, $classes) = @_; - ok((my $rs = eval { $schema->resultset('MssqlLoaderTest1Dot') }), + my $vendor_titlecased = "\u\L$vendor"; + + ok((my $rs = eval { + $schema->resultset("${vendor_titlecased}LoaderTest1Dot") }), 'got a resultset'); ok((my $from = eval { $rs->result_source->from }), @@ -24,7 +34,7 @@ sub extra { +{ is ref($from), 'SCALAR', '->table is a scalar ref'; - is eval { $$from }, '[mssql_loader_test1.dot]', + is eval { $$from }, "[${vendor}_loader_test1.dot]", '->table name is correct'; }, }}