);
# Test that a disconnect doesnt harm anything.
-Film->db_Main->disconnect;
-@films = Film->search({ Rating => 'NC-17' });
-ok(@films == 1 && $films[0]->id eq $gone->id, 'auto reconnection');
-
-# Test discard_changes().
-my $orig_director = $btaste->Director;
-$btaste->Director('Lenny Bruce');
-is($btaste->Director, 'Lenny Bruce', 'set new Director');
-$btaste->discard_changes;
-is($btaste->Director, $orig_director, 'discard_changes()');
+{
+ # SQLite is loud on disconnect/reconnect.
+ # This is solved in DBIC but not in ContextualFetch
+ local $SIG{__WARN__} = sub {
+ warn @_ unless $_[0] =~
+ /active statement handles|inactive database handle/;
+ };
+
+ Film->db_Main->disconnect;
+ @films = Film->search({ Rating => 'NC-17' });
+ ok(@films == 1 && $films[0]->id eq $gone->id, 'auto reconnection');
+
+ # Test discard_changes().
+ my $orig_director = $btaste->Director;
+ $btaste->Director('Lenny Bruce');
+ is($btaste->Director, 'Lenny Bruce', 'set new Director');
+ $btaste->discard_changes;
+ is($btaste->Director, $orig_director, 'discard_changes()');
+}
SKIP: {
skip "ActiveState perl produces additional warnings", 3
like $@, qr/film/, "no hasa film";
eval {
+ local $SIG{__WARN__} = sub {
+ warn @_ unless $_[0] =~ /Query returned more than one row/;
+ };
ok my $f = $ac->movie, "hasa movie";
isa_ok $f, "Film";
is $f->id, $bt->id, " - Bad Taste";
use strict;
use Test::More;
+use Data::Dumper;
BEGIN {
eval "use DBIx::Class::CDBICompat;";
is $dir->nasties, 1, "We have one nasty";
ok $dir->delete;
- ok +Film->retrieve("Alligator"), "has_many with @{[ keys %$args ]} => @{[ values %$args ]}";
+ local $Data::Dumper::Terse = 1;
+ ok +Film->retrieve("Alligator"), 'has_many with ' . Dumper ($args);;
$kk->delete;
}
use vars qw/$dbh/;
-my @connect = ("dbi:mysql:test", "", "");
+# temporary, might get switched to the new test framework someday
+my @connect = ("dbi:mysql:test", "", "", { PrintError => 0});
$dbh = DBI->connect(@connect) or die DBI->errstr;
my @table;