X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F746mssql.t;h=a75001e2848ac57da3e42afa36894d248b17bbf4;hb=afcfff010f5a1d6dbc3a5fb6dfbaeb6246c33372;hp=2ee8cc35adf6cb3ba8fcbab59198673d4150fc3d;hpb=f66e15f39f65384d95c4a254b9aefe14f32e49e3;p=dbsrgits%2FDBIx-Class.git diff --git a/t/746mssql.t b/t/746mssql.t index 2ee8cc3..a75001e 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -12,8 +12,6 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_ODBC_${_}" } qw/DSN USER PA plan skip_all => 'Set $ENV{DBICTEST_MSSQL_ODBC_DSN}, _USER and _PASS to run this test' unless ($dsn && $user); -plan tests => 39; - DBICTest::Schema->load_classes('ArtistGUID'); my $schema = DBICTest::Schema->connect($dsn, $user, $pass); @@ -220,6 +218,19 @@ lives_ok ( sub { ]); }, 'populate with PKs supplied ok' ); +lives_ok (sub { + # start a new connection, make sure rebless works + # test an insert with a supplied identity, followed by one without + my $schema = DBICTest::Schema->connect($dsn, $user, $pass); + for (1..2) { + my $id = $_ * 20 ; + $schema->resultset ('Owners')->create ({ id => $id, name => "troglodoogle $id" }); + $schema->resultset ('Owners')->create ({ name => "troglodoogle " . ($id + 1) }); + } +}, 'create with/without PKs ok' ); + +is ($schema->resultset ('Owners')->count, 19, 'owner rows really in db' ); + lives_ok ( sub { # start a new connection, make sure rebless works my $schema = DBICTest::Schema->connect($dsn, $user, $pass); @@ -329,9 +340,10 @@ $schema->storage->_sql_maker->{name_sep} = '.'; ], ); } - } +done_testing; + # clean up our mess END { if (my $dbh = eval { $schema->storage->_dbh }) {