Bug 19760: Fix Config.t test
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 22 Dec 2017 17:04:52 +0000 (14:04 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 22 Dec 2017 17:04:52 +0000 (14:04 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/Koha/Config.t

index 2ae3c25..b4168b9 100644 (file)
@@ -52,10 +52,8 @@ subtest 'read_from_file() tests' => sub {
 
     $parsing_result = 'error';
 
-    warning_is
-        {$result = Koha::Config->read_from_file("SomeFile.xml")}
-        'Error reading file SomeFile.xml',
-        'File failing to read raises warning';
+    $result = eval {Koha::Config->read_from_file("SomeFile.xml")};
+    like( $@, qr{.*Error reading file.*}, 'File failing to read raises warning');
     is( $result, undef, 'Returns undef on error confition' );
 };