# POD is generated automatically by calling _gen_pod from the
# Makefile.PL in $AUTHOR mode
+my $json_any = {
+ 'JSON::Any' => '1.22',
+};
+
my $moose_basic = {
'Moose' => '0.98',
'MooseX::Types' => '0.21',
my $admin_basic = {
%$moose_basic,
+ %$json_any,
'MooseX::Types::Path::Class' => '0.05',
'MooseX::Types::JSON' => '0.02',
- 'JSON::Any' => '1.22',
'namespace::autoclean' => '0.09',
};
},
},
-
test_pod => {
req => {
'Test::Pod' => '1.41',
},
},
+ test_prettydebug => {
+ req => $json_any,
+ },
+
test_leaks => {
req => {
'Test::Memory::Cycle' => '0',
require DBIx::Class::Storage::Debug::PrettyPrint;
if ($profile =~ /^\.?\//) {
require Config::Any;
- my $cfg = Config::Any->load_files({ files => [$profile], use_ext => 1 });
+
+ my $cfg = try {
+ Config::Any->load_files({ files => [$profile], use_ext => 1 });
+ } catch {
+ # sanitize the error message a bit
+ $_ =~ s/at \s+ .+ Storage\.pm \s line \s \d+ $//x;
+ $self->throw_exception("Failure processing \$ENV{DBIC_TRACE_PROFILE}: $_");
+ };
my ($filename, $config) = %{$cfg->[0]};
$debugobj = DBIx::Class::Storage::Debug::PrettyPrint->new($config)
sub throw_exception {
my $self = shift;
- if ($self->schema) {
+ if (ref $self and $self->schema) {
$self->schema->throw_exception(@_);
}
else {
use DBICTest;
use Test::More;
+BEGIN {
+ require DBIx::Class;
+ plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_prettydebug')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_prettydebug');
+}
+
BEGIN { delete @ENV{qw(DBIC_TRACE_PROFILE)} }
{