Commit | Line | Data |
5c06aa08 |
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_comments; |
9 | use dbixcsl_test_dir qw/$tdir/; |
10 | |
11 | my $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, |
18 | ); |
19 | } |
20 | |
21 | DBICTest::Schema::1->connect($make_dbictest_db_comments::dsn); |
22 | |
23 | plan tests => 4; |
24 | |
25 | my $foo = slurp("$dump_path/DBICTest/Schema/1/Result/Foo.pm"); |
26 | my $bar = slurp("$dump_path/DBICTest/Schema/1/Result/Bar.pm"); |
27 | |
28 | like($foo, qr/Result::Foo - a short comment/, 'Short table comment inline'); |
29 | like($bar, qr/Result::Bar\n\n=head1 DESCRIPTION\n\na (very ){80}long comment/, |
30 | 'Long table comment in DESCRIPTION'); |
31 | |
32 | like($foo, qr/=head2 fooid\n\n( .*\n)+\na short comment/, |
33 | 'Short column comment recorded'); |
34 | like($foo, qr/=head2 footext\n\n( .*\n)+\na (very ){80}long comment/, |
35 | 'Long column comment recorded'); |
36 | |
37 | END { rmtree($dump_path, 1, 1); } |