X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdbic%2Fshow-progress.t;fp=t%2Fdbic%2Fshow-progress.t;h=672d635a96c6cf331bd1b257eb86fc7e6e97917e;hb=13662f979a4458c63055fbdde32e389e0c6ea577;hp=0000000000000000000000000000000000000000;hpb=7c2d702e410b5043ec1008f0deaed436cda74828;p=scpubgit%2FQ-Branch.git diff --git a/t/dbic/show-progress.t b/t/dbic/show-progress.t new file mode 100644 index 0000000..672d635 --- /dev/null +++ b/t/dbic/show-progress.t @@ -0,0 +1,31 @@ +use strict; +use warnings; + +use Test::More; +use DBIx::Class::Storage::Debug::PrettyPrint; + +my $cap; +open my $fh, '>', \$cap; + +my $pp = DBIx::Class::Storage::Debug::PrettyPrint->new({ + show_progress => 1, + clear_line => 'CLEAR', + executing => 'GOGOGO', +}); + +$pp->debugfh($fh); + +$pp->query_start('SELECT * FROM frew WHERE id = 1'); +is( + $cap, + qq(SELECT * FROM frew WHERE id = 1 : \nGOGOGO), + 'SQL Logged' +); +$pp->query_end('SELECT * FROM frew WHERE id = 1'); +is( + $cap, + qq(SELECT * FROM frew WHERE id = 1 : \nGOGOGOCLEAR), + 'SQL Logged' +); + +done_testing;