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