Commit | Line | Data |
c0329273 |
1 | BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } |
cb551b07 |
2 | use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_prettydebug'; |
3 | |
b6cd6478 |
4 | use strict; |
5 | use warnings; |
cb551b07 |
6 | |
c0329273 |
7 | |
b6cd6478 |
8 | use DBICTest; |
9 | use Test::More; |
10 | |
11 | BEGIN { delete @ENV{qw(DBIC_TRACE_PROFILE)} } |
12 | |
13 | { |
14 | my $schema = DBICTest->init_schema; |
15 | |
16 | isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Statistics'); |
17 | } |
18 | |
19 | { |
20 | local $ENV{DBIC_TRACE_PROFILE} = 'console'; |
21 | |
22 | my $schema = DBICTest->init_schema; |
23 | |
24 | isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyPrint');; |
25 | is($schema->storage->debugobj->_sqlat->indent_string, ' ', 'indent string set correctly from console profile'); |
26 | } |
27 | |
0dd1b736 |
28 | SKIP:{ |
29 | DBIx::Class::Optional::Dependencies->skip_without('config_file_reader' ); |
30 | |
b6cd6478 |
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 | |
39 | done_testing; |