Fix building on perls with no . in @INC
[dbsrgits/DBIx-Class.git] / t / 73oracle_hq.t
index 26b9bd7..0dde669 100644 (file)
@@ -1,3 +1,6 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_oracle';
+
 use strict;
 use warnings;
 
@@ -8,24 +11,8 @@ use Test::More;
 # dealing with HQs. So just punt on the entire shuffle thing.
 BEGIN { $ENV{DBIC_SHUFFLE_UNORDERED_RESULTSETS} = 0 }
 
-
-use DBIx::Class::Optional::Dependencies ();
-use lib qw(t/lib);
-
-$ENV{NLS_SORT} = "BINARY";
-$ENV{NLS_COMP} = "BINARY";
-$ENV{NLS_LANG} = "AMERICAN";
-
-my ($dsn,  $user,  $pass)  = @ENV{map { "DBICTEST_ORA_${_}" }  qw/DSN USER PASS/};
-
-plan skip_all => 'Set $ENV{DBICTEST_ORA_DSN}, _USER and _PASS to run this test.'
- unless ($dsn && $user && $pass);
-
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_oracle')
-  unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_oracle');
-
-{
-  require DBICTest::Schema::Artist;
+use DBICTest::Schema::Artist;
+BEGIN {
   DBICTest::Schema::Artist->add_column('parentid');
 
   DBICTest::Schema::Artist->has_many(
@@ -40,8 +27,14 @@ plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missin
 }
 
 use DBICTest;
+use DBICTest::Schema;
+
+$ENV{NLS_SORT} = "BINARY";
+$ENV{NLS_COMP} = "BINARY";
+$ENV{NLS_LANG} = "AMERICAN";
 
-my $schema = DBICTest->connect_schema($dsn, $user, $pass);
+my ($dsn,  $user,  $pass)  = @ENV{map { "DBICTEST_ORA_${_}" }  qw/DSN USER PASS/};
+my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
 
 note "Oracle Version: " . $schema->storage->_server_info->{dbms_version};