From b585f7c15b024bda49037e3a09e9a96f770eb151 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Fri, 5 May 2017 14:54:06 +0200
Subject: [PATCH] Use modern replacement for
Mojo::Message::Response::is_success()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Mojilicious 7.13 deprecated Mojo::Message::Response::is_success() and
7.31 removed it. Thus tests fail now.
This patch replaces the is_success() calls with their modern
replacements.
CPAN RT#121395
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
Makefile.PL | 2 +-
lib/MojoX/JSON/RPC/Client.pm | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.PL b/Makefile.PL
index 4adb6ac..4d6a7bc 100755
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -12,7 +12,7 @@ WriteMakefile(
VERSION_FROM => 'lib/MojoX/JSON/RPC.pm',
ABSTRACT => 'Perl implementation of JSON-RPC 2.0 protocol for Mojolicious',
AUTHOR => 'Henry Tang <henryykt@gmail.com>',
- PREREQ_PM => { 'Mojolicious' => '5.77' },
+ PREREQ_PM => { 'Mojolicious' => '7.13' },
LICENSE => 'artistic_2',
test => { TESTS => 't/*.t t/*/*.t t/*/*/*.t' },
META_MERGE => {
diff --git a/lib/MojoX/JSON/RPC/Client.pm b/lib/MojoX/JSON/RPC/Client.pm
index ef47b2b..f8fbbff 100644
--- a/lib/MojoX/JSON/RPC/Client.pm
+++ b/lib/MojoX/JSON/RPC/Client.pm
@@ -108,7 +108,7 @@ sub _process_result {
}
# Check if RPC call is succesfull
- if ( !( $tx_res->is_status_class(200) || $tx_res->is_status_class(400) ) )
+ if ( !( $tx_res->is_success || $tx_res->is_client_error ) )
{
return;
}
--
2.9.3