From: Peter Rabbitson Date: Wed, 23 Feb 2011 13:10:24 +0000 (+0100) Subject: Fix quote_names assumption of DBD::* availability X-Git-Tag: v0.08191~78 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=665f62861f11befaaba1f6b9bae1b32bb650588a;p=dbsrgits%2FDBIx-Class.git Fix quote_names assumption of DBD::* availability --- diff --git a/t/storage/quote_names.t b/t/storage/quote_names.t index 073d7f3..f77c3de 100644 --- a/t/storage/quote_names.t +++ b/t/storage/quote_names.t @@ -49,10 +49,12 @@ my %expected = ( { quote_char => [ '[', ']' ], name_sep => '.' }, ); -while (my ($class, $mapping) = each %expected) { +for my $class (keys %expected) { SKIP: { + eval "require ${class}" + or skip "Skipping test of quotes for $class due to missing dependencies", 1; + + my $mapping = $expected{$class}; my ($quote_char, $name_sep) = @$mapping{qw/quote_char name_sep/}; - eval "require ${class};"; - die $@ if $@; my $instance = $class->new; my $quote_char_text = dumper($quote_char); @@ -64,7 +66,7 @@ while (my ($class, $mapping) = each %expected) { is $instance->sql_name_sep, $name_sep, "sql_name_sep for $class is '$name_sep'"; -} +}} # Try quote_names with available DBs.