Created
March 30, 2012 17:45
-
-
Save rkitover/2253305 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Test::More; | |
use Test::Exception; | |
use DBIx::Class::Schema::Loader; | |
# use this if you keep a copy of DBD::Sybase linked to FreeTDS somewhere else | |
BEGIN { | |
if (my $lib_dirs = $ENV{DBICTEST_MSSQL_PERL5LIB}) { | |
unshift @INC, $_ for split /:/, $lib_dirs; | |
} | |
} | |
my ($dsn, $user, $pass); | |
for (qw/MSSQL_ODBC MSSQL_ADO MSSQL/) { | |
next unless $ENV{"DBICTEST_${_}_DSN"}; | |
$dsn = $ENV{"DBICTEST_${_}_DSN"}; | |
$user = $ENV{"DBICTEST_${_}_USER"}; | |
$pass = $ENV{"DBICTEST_${_}_PASS"}; | |
last; | |
} | |
plan ($dsn ? (tests => 1) : (skip_all => 'MSSQL required for this test')); | |
lives_ok { | |
DBIx::Class::Schema::Loader::make_schema_at( | |
'DBICTest::Schema', | |
{ naming => 'current' }, | |
[ $dsn, $user, $pass ], | |
); | |
} 'dynamic MSSQL schema created using make_schema_at'; | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment