plan ( ($] >= 5.009000 and $] < 5.010001)
? (skip_all => 'warnings::register broken under 5.10: http://rt.perl.org/rt3/Public/Bug/Display.html?id=62522')
- : (tests => 2)
+ : (tests => 4)
);
{
my @w;
local $SIG{__WARN__} = sub { push @w, @_ };
-
my $code = gen_code ( suffix => 1 );
eval "$code";
+ ok (! $@, 'Eval code without warnings suppression')
+ || diag $@;
ok ( (grep { $_ =~ /The many-to-many relationship bars is trying to create/ } @w), "Warning triggered without relevant 'no warnings'");
}
my $code = gen_code ( suffix => 2, no_warn => 1 );
eval "$code";
+ ok (! $@, 'Eval code with warnings suppression')
+ || diag $@;
ok ( (not grep { $_ =~ /The many-to-many relationship bars is trying to create/ } @w), "No warning triggered with relevant 'no warnings'");
}
package #
DBICTest::Schema::Foo${suffix};
use base 'DBIx::Class::Core';
+
__PACKAGE__->table('foo');
__PACKAGE__->add_columns(
'fooid' => {
DBICTest::Schema::Bar${suffix};
use base 'DBIx::Class::Core';
+
__PACKAGE__->table('bar');
__PACKAGE__->add_columns(
'barid' => {