fix and regression test for RT #62642
[dbsrgits/DBIx-Class.git] / t / storage / dbic_pretty.t
CommitLineData
b6cd6478 1use strict;
2use warnings;
3use lib qw(t/lib);
4use DBICTest;
5use Test::More;
6
2a2a7b23 7BEGIN {
8 require DBIx::Class;
9 plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_prettydebug')
10 unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_prettydebug');
11}
12
b6cd6478 13BEGIN { delete @ENV{qw(DBIC_TRACE_PROFILE)} }
14
15{
16 my $schema = DBICTest->init_schema;
17
18 isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Statistics');
19}
20
21{
22 local $ENV{DBIC_TRACE_PROFILE} = 'console';
23
24 my $schema = DBICTest->init_schema;
25
26 isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyPrint');;
27 is($schema->storage->debugobj->_sqlat->indent_string, ' ', 'indent string set correctly from console profile');
28}
29
30{
31 local $ENV{DBIC_TRACE_PROFILE} = './t/lib/awesome.json';
32
33 my $schema = DBICTest->init_schema;
34
35 isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyPrint');;
36 is($schema->storage->debugobj->_sqlat->indent_string, 'frioux', 'indent string set correctly from file-based profile');
37}
38
39done_testing;