Commit | Line | Data |
383bd2a8 |
1 | use strict; |
2 | use warnings; |
3 | use Test::More; |
4 | use Test::Exception; |
5 | use DBIx::Class::Schema::Loader; |
6 | |
7 | # use this if you keep a copy of DBD::Sybase linked to FreeTDS somewhere else |
8 | BEGIN { |
494e0205 |
9 | if (my $lib_dirs = $ENV{DBICTEST_MSSQL_PERL5LIB}) { |
10 | unshift @INC, $_ for split /:/, $lib_dirs; |
11 | } |
383bd2a8 |
12 | } |
13 | |
14 | my ($dsn, $user, $pass); |
15 | |
16 | for (qw/MSSQL_ODBC MSSQL_ADO MSSQL/) { |
494e0205 |
17 | next unless $ENV{"DBICTEST_${_}_DSN"}; |
383bd2a8 |
18 | |
494e0205 |
19 | $dsn = $ENV{"DBICTEST_${_}_DSN"}; |
20 | $user = $ENV{"DBICTEST_${_}_USER"}; |
21 | $pass = $ENV{"DBICTEST_${_}_PASS"}; |
383bd2a8 |
22 | |
494e0205 |
23 | last; |
383bd2a8 |
24 | } |
25 | |
26 | plan skip_all => 'perl 5.8 required for this test' |
27 | if $] >= 5.009005; |
28 | |
29 | plan ($dsn ? (tests => 1) : (skip_all => 'MSSQL required for this test')); |
30 | |
31 | lives_ok { |
32 | DBIx::Class::Schema::Loader::make_schema_at( |
33 | 'DBICTest::Schema', |
34 | { naming => 'current' }, |
35 | [ $dsn, $user, $pass ], |
36 | ); |
37 | } 'dynamic MSSQL schema created using make_schema_at'; |
38 | |
39 | done_testing; |