Commit | Line | Data |
cb551b07 |
1 | use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_prettydebug'; |
2 | |
b6cd6478 |
3 | use strict; |
4 | use warnings; |
cb551b07 |
5 | |
b6cd6478 |
6 | use lib qw(t/lib); |
7 | use DBICTest; |
8 | use Test::More; |
9 | |
10 | BEGIN { delete @ENV{qw(DBIC_TRACE_PROFILE)} } |
11 | |
12 | { |
13 | my $schema = DBICTest->init_schema; |
14 | |
15 | isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Statistics'); |
16 | } |
17 | |
18 | { |
19 | local $ENV{DBIC_TRACE_PROFILE} = 'console'; |
20 | |
21 | my $schema = DBICTest->init_schema; |
22 | |
23 | isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyPrint');; |
24 | is($schema->storage->debugobj->_sqlat->indent_string, ' ', 'indent string set correctly from console profile'); |
25 | } |
26 | |
0dd1b736 |
27 | SKIP:{ |
28 | DBIx::Class::Optional::Dependencies->skip_without('config_file_reader' ); |
29 | |
b6cd6478 |
30 | local $ENV{DBIC_TRACE_PROFILE} = './t/lib/awesome.json'; |
31 | |
32 | my $schema = DBICTest->init_schema; |
33 | |
34 | isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyPrint');; |
35 | is($schema->storage->debugobj->_sqlat->indent_string, 'frioux', 'indent string set correctly from file-based profile'); |
36 | } |
37 | |
38 | done_testing; |