94c14324b8ecf4b655ec74249dc0481c28ee456f
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 30_02bad_comment_table.t
1 use strict;
2 use Test::More;
3 use Test::Exception;
4 use Test::Warn;
5 use lib qw(t/lib);
6 use File::Slurp qw(slurp);
7 use File::Path;
8 use make_dbictest_db_bad_comment_tables;
9 use dbixcsl_test_dir qw/$tdir/;
10 use Try::Tiny;
11
12 my $dump_path = "$tdir/dump";
13
14 {
15     package DBICTest::Schema::1;
16     use base qw/ DBIx::Class::Schema::Loader /;
17     __PACKAGE__->loader_options(
18         dump_directory => $dump_path,
19     );
20 }
21
22 try {
23     DBICTest::Schema::1->connect($make_dbictest_db_bad_comment_tables::dsn);
24 };
25
26 plan tests => 1;
27
28 my $foo = try { slurp("$dump_path/DBICTest/Schema/1/Result/Foo.pm") };
29 my $bar = try { slurp("$dump_path/DBICTest/Schema/1/Result/Bar.pm") };
30
31 like($foo, qr/Result::Foo\n/, 'No error from invalid comment tables');
32
33 END { rmtree($dump_path, 1, 1); }