From 75bcf6b8626125cd29e1bb4846022f9de080bd70 Mon Sep 17 00:00:00 2001 From: Alexander Hartmaier Date: Sat, 23 Oct 2010 11:39:34 +0200 Subject: [PATCH] use Carp::Clan instead of warn --- dist.ini | 1 + lib/DBIx/Class/ResultSet/RecursiveUpdate.pm | 4 ++-- t/lib/RunTests.pm | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dist.ini b/dist.ini index d98cf83..03ff85e 100644 --- a/dist.ini +++ b/dist.ini @@ -40,6 +40,7 @@ DateTime = 0 DBD::SQLite = 1.21 Readonly = 1.03 List::MoreUtils = 0.22 +Carp::Clan = 6.04 [Prereqs / TestRequires] Test::More = 0.88 diff --git a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm index 6594748..4e4c370 100644 --- a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm +++ b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm @@ -34,7 +34,7 @@ sub recursive_update { } package DBIx::Class::ResultSet::RecursiveUpdate::Functions; -use Carp; +use Carp::Clan; use Scalar::Util qw( blessed ); use List::MoreUtils qw/ any /; @@ -145,7 +145,7 @@ sub recursive_update { # don't throw a warning instead of an exception to give users # time to adapt to the new API - warn( + carp( "No such column, relationship, many-to-many helper accessor or generic accessor '$name'" ) unless $unknown_params_ok; diff --git a/t/lib/RunTests.pm b/t/lib/RunTests.pm index 7121ed2..3dba310 100644 --- a/t/lib/RunTests.pm +++ b/t/lib/RunTests.pm @@ -59,10 +59,10 @@ sub run_tests { # qr/No such column, relationship, many-to-many helper accessor or generic accessor 'nonexisting'/, # 'nonexisting column, accessor, relationship fails' # ); - warning_is { + warning_like { my $user = $user_rs->recursive_update($updates); } - "No such column, relationship, many-to-many helper accessor or generic accessor 'nonexisting'", + qr/No such column, relationship, many-to-many helper accessor or generic accessor 'nonexisting'/, 'nonexisting column, accessor, relationship warns'; $expected_user_count++; is( $user_rs->count, $expected_user_count, 'User created' ); -- 2.45.2