Stop importing all the POSIX functions
[dbsrgits/DBIx-Class.git] / t / storage / dbic_pretty.t
1 use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_prettydebug';
2
3 use strict;
4 use warnings;
5
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
27 {
28    local $ENV{DBIC_TRACE_PROFILE} = './t/lib/awesome.json';
29
30    my $schema = DBICTest->init_schema;
31
32    isa_ok($schema->storage->debugobj, 'DBIx::Class::Storage::Debug::PrettyPrint');;
33    is($schema->storage->debugobj->_sqlat->indent_string, 'frioux', 'indent string set correctly from file-based profile');
34 }
35
36 done_testing;