Skip to content

Commit

Permalink
Merge pull request #2 from szabgab/master
Browse files Browse the repository at this point in the history
incorrect e-mail address of RT
  • Loading branch information
Corion committed May 23, 2012
2 parents ae2bf91 + 1bd17a5 commit a895d8b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lib/DBIx/RunSQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ L<http://perlmonks.org/>.
Please report bugs in this module via the RT CPAN bug queue at
L<https://rt.cpan.org/Public/Dist/Display.html?Name=DBIx-RunSQL>
or via mail to L<dbix-runsql-Bugs@rt.cpan.org>.
or via mail to L<bug-dbix-runsql@rt.cpan.org>.
=head1 AUTHOR
Expand Down
61 changes: 30 additions & 31 deletions t/01-force.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!perl -w
use strict;
use Test::More tests => 5;
use Test::More;

use DBIx::RunSQL;

Expand All @@ -9,34 +9,33 @@ my $can_run = eval {
1
};

if ($can_run) {
my $warn;
local $SIG{__WARN__} = sub { $warn = shift };
my $lives = eval {
my $test_dbh = DBIx::RunSQL->create(
dsn => 'dbi:SQLite:dbname=:memory:',
sql => $0,
);
1;
};
my $err = $@;
ok !$lives, "We die on invalid SQL";
isn't $@, '', "We die with some error message";
$lives = eval {
my $test_dbh = DBIx::RunSQL->create(
dsn => 'dbi:SQLite:dbname=:memory:',
sql => $0,
force => 1,
);
1;
};
$err = $@;
ok $lives, "We can force invalid SQL";
is $@, '', "We don't die with some error message";
like $warn, qr/SQL ERROR/, "We still warn about SQL errors";
} else {
SKIP: {
skip "SQLite not installed", 4
}
if (not $can_run) {
plan skip_all => "SQLite not installed";
}

plan tests => 5;
my $warn;
local $SIG{__WARN__} = sub { $warn = shift };
my $lives = eval {
my $test_dbh = DBIx::RunSQL->create(
dsn => 'dbi:SQLite:dbname=:memory:',
sql => $0,
);
1;
};
my $err = $@;
ok !$lives, "We die on invalid SQL";
isn't $@, '', "We die with some error message";
$lives = eval {
my $test_dbh = DBIx::RunSQL->create(
dsn => 'dbi:SQLite:dbname=:memory:',
sql => $0,
force => 1,
);
1;
};
$err = $@;
ok $lives, "We can force invalid SQL";
is $@, '', "We don't die with some error message";
like $warn, qr/SQL ERROR/, "We still warn about SQL errors";

0 comments on commit a895d8b

Please sign in to comment.