Release 1.70
[scpubgit/Q-Branch.git] / t / dbic / show-progress.t
CommitLineData
13662f97 1use strict;
2use warnings;
3
4use Test::More;
5use DBIx::Class::Storage::Debug::PrettyPrint;
6
7my $cap;
8open my $fh, '>', \$cap;
9
10my $pp = DBIx::Class::Storage::Debug::PrettyPrint->new({
11 show_progress => 1,
12 clear_line => 'CLEAR',
13 executing => 'GOGOGO',
14});
15
16$pp->debugfh($fh);
17
18$pp->query_start('SELECT * FROM frew WHERE id = 1');
19is(
20 $cap,
21 qq(SELECT * FROM frew WHERE id = 1 : \nGOGOGO),
22 'SQL Logged'
23);
24$pp->query_end('SELECT * FROM frew WHERE id = 1');
25is(
26 $cap,
27 qq(SELECT * FROM frew WHERE id = 1 : \nGOGOGOCLEAR),
28 'SQL Logged'
29);
30
31done_testing;