Actually use the descriptions in the test cases
[dbsrgits/SQL-Abstract.git] / t / dbic / show-progress.t
CommitLineData
13662f97 1use strict;
2use warnings;
3
4use Test::More;
aa2ae81e 5
6BEGIN {
7 # ask for a recent DBIC version to skip the 5.6.2 tests as well
8 plan skip_all => 'Test temporarily requires DBIx::Class'
9 unless eval { require DBIx::Class::Storage::Statistics; DBIx::Class->VERSION('0.08124') };
10}
11
13662f97 12use DBIx::Class::Storage::Debug::PrettyPrint;
13
14my $cap;
15open my $fh, '>', \$cap;
16
17my $pp = DBIx::Class::Storage::Debug::PrettyPrint->new({
18 show_progress => 1,
19 clear_line => 'CLEAR',
20 executing => 'GOGOGO',
21});
22
23$pp->debugfh($fh);
24
25$pp->query_start('SELECT * FROM frew WHERE id = 1');
26is(
27 $cap,
28 qq(SELECT * FROM frew WHERE id = 1 : \nGOGOGO),
29 'SQL Logged'
30);
31$pp->query_end('SELECT * FROM frew WHERE id = 1');
32is(
33 $cap,
34 qq(SELECT * FROM frew WHERE id = 1 : \nGOGOGOCLEAR),
35 'SQL Logged'
36);
37
38done_testing;