silence comment tests
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 30_01comments.t
CommitLineData
5c06aa08 1use strict;
2use Test::More;
3use Test::Exception;
4use Test::Warn;
5use lib qw(t/lib);
6use File::Slurp qw(slurp);
7use File::Path;
8use make_dbictest_db_comments;
9use dbixcsl_test_dir qw/$tdir/;
10
11my $dump_path = "$tdir/dump";
12
13{
14 package DBICTest::Schema::1;
15 use base qw/ DBIx::Class::Schema::Loader /;
16 __PACKAGE__->loader_options(
17 dump_directory => $dump_path,
a47e6e74 18 quiet => 1,
5c06aa08 19 );
20}
21
22DBICTest::Schema::1->connect($make_dbictest_db_comments::dsn);
23
24plan tests => 4;
25
26my $foo = slurp("$dump_path/DBICTest/Schema/1/Result/Foo.pm");
27my $bar = slurp("$dump_path/DBICTest/Schema/1/Result/Bar.pm");
28
29like($foo, qr/Result::Foo - a short comment/, 'Short table comment inline');
30like($bar, qr/Result::Bar\n\n=head1 DESCRIPTION\n\na (very ){80}long comment/,
31 'Long table comment in DESCRIPTION');
32
33like($foo, qr/=head2 fooid\n\n( .*\n)+\na short comment/,
34 'Short column comment recorded');
35like($foo, qr/=head2 footext\n\n( .*\n)+\na (very ){80}long comment/,
36 'Long column comment recorded');
37
38END { rmtree($dump_path, 1, 1); }