Add import-time-skip support to OptDeps, switch most tests over to that
[dbsrgits/DBIx-Class.git] / t / storage / dbic_pretty.t
CommitLineData
cb551b07 1use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_prettydebug';
2
b6cd6478 3use strict;
4use warnings;
cb551b07 5
b6cd6478 6use lib qw(t/lib);
7use DBICTest;
8use Test::More;
9
10BEGIN { 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
36done_testing;