better money value comparison in tests
[dbsrgits/DBIx-Class.git] / t / 39load_namespaces_1.t
index 8d2dec3..f20ca8c 100644 (file)
@@ -4,9 +4,10 @@ use strict;
 use warnings;
 use Test::More;
 
-unshift(@INC, './t/lib');
+use lib qw(t/lib);
+use DBICTest; # do not remove even though it is not used
 
-plan tests => 6;
+plan tests => 8;
 
 my $warnings;
 eval {
@@ -16,7 +17,7 @@ eval {
     __PACKAGE__->load_namespaces;
 };
 ok(!$@) or diag $@;
-like($warnings, qr/load_namespaces found ResultSet class C with no corresponding source-definition class/);
+like($warnings, qr/load_namespaces found ResultSet class C with no corresponding Result class/);
 
 my $source_a = DBICNSTest->source('A');
 isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
@@ -27,3 +28,8 @@ my $source_b = DBICNSTest->source('B');
 isa_ok($source_b, 'DBIx::Class::ResultSource::Table');
 my $rset_b   = DBICNSTest->resultset('B');
 isa_ok($rset_b, 'DBIx::Class::ResultSet');
+
+for my $moniker (qw/A B/) {
+  my $class = "DBICNSTest::Result::$moniker";
+  ok(!defined($class->result_source_instance->source_name));
+}