DBIC_TRACE_PROFILE
[dbsrgits/DBIx-Class.git] / t / storage / dbic_pretty.t
1 use strict;
2 use warnings;
3 use lib qw(t/lib);
4 use DBICTest;
5 use Test::More;
6
7 BEGIN { delete @ENV{qw(DBIC_TRACE_PROFILE)} }
8
9 {
10    my $schema = DBICTest->init_schema;
11
12    isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Statistics');
13 }
14
15 {
16    local $ENV{DBIC_TRACE_PROFILE} = 'console';
17
18    my $schema = DBICTest->init_schema;
19
20    isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyPrint');;
21    is($schema->storage->debugobj->_sqlat->indent_string, ' ', 'indent string set correctly from console profile');
22 }
23
24 {
25    local $ENV{DBIC_TRACE_PROFILE} = './t/lib/awesome.json';
26
27    my $schema = DBICTest->init_schema;
28
29    isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyPrint');;
30    is($schema->storage->debugobj->_sqlat->indent_string, 'frioux', 'indent string set correctly from file-based profile');
31 }
32
33 done_testing;