use strict;
use Test::More;
+use DBIx::Class::Schema::Loader::Optional::Dependencies;
use lib qw(t/lib);
use make_dbictest_db;
);
DBICTest::Schema::12->clone;
},
- 'skip_load_external_1' => sub {
+ 'no_skip_load_external' => sub {
# By default we should pull in t/lib/DBICTest/Schema/13/Foo.pm $skip_me since t/lib is in @INC
use DBIx::Class::Schema::Loader;
DBIx::Class::Schema::Loader::make_schema_at(
);
DBICTest::Schema::13->clone;
},
- 'skip_load_external_2' => sub {
+ 'skip_load_external' => sub {
# When we explicitly skip_load_external t/lib/DBICTest/Schema/14/Foo.pm should be ignored
use DBIx::Class::Schema::Loader;
DBIx::Class::Schema::Loader::make_schema_at(
);
DBICTest::Schema::14->clone;
},
+ (DBIx::Class::Schema::Loader::Optional::Dependencies->req_ok_for('use_moose') ?
+ ('moose' => sub {
+ package DBICTest::Schema::8;
+ use base qw/ DBIx::Class::Schema::Loader /;
+ __PACKAGE__->naming('current');
+ __PACKAGE__->connect(
+ $make_dbictest_db::dsn,
+ { loader_options => { use_moose => 1 } }
+ );
+ })
+ : ()
+ ),
);
# 4 tests per k/v pair
test_schema($style, &$subref);
}
-is($DBICTest::Schema::13::Foo::skip_me, "bad mojo", "skip_load_external_1 skip_me");
-is($DBICTest::Schema::14::Foo::skip_me, undef, "skip_load_external_2 skip_me");
+{
+ no warnings 'once';
+ is($DBICTest::Schema::13::Foo::skip_me, "bad mojo",
+ "external content loaded");
+ is($DBICTest::Schema::14::Foo::skip_me, undef,
+ "external content not loaded with skip_load_external => 1");
+}