Advertisement
Guest User

Untitled

a guest
May 5th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.94 KB | None | 0 0
  1. From 51861c1c4fcebc9ae417e802fa221da7e9beb4de Mon Sep 17 00:00:00 2001
  2. From: Julian FIOL <julian.fiol@biblibre.com>
  3. Date: Thu, 9 Apr 2015 16:22:48 +0200
  4. Subject: [PATCH] Bug 13940 : (QA followup) Add tests for the 2 warnings which
  5.  was not tested
  6.  
  7. ---
  8.  t/db_dependent/OAI/Sets.t | 19 ++++++++++---------
  9.  1 file changed, 10 insertions(+), 9 deletions(-)
  10.  
  11. diff --git a/t/db_dependent/OAI/Sets.t b/t/db_dependent/OAI/Sets.t
  12. index 07aa4d4..932e457 100644
  13. --- a/t/db_dependent/OAI/Sets.t
  14. +++ b/t/db_dependent/OAI/Sets.t
  15. @@ -18,8 +18,9 @@
  16.  
  17.  use Modern::Perl;
  18.  use C4::Context;
  19. -use Test::More tests => 145;
  20. +use Test::More tests => 147;
  21.  use Test::MockModule;
  22. +use Test::Warn;
  23.  
  24.  
  25.  BEGIN {
  26. @@ -88,9 +89,12 @@ ok (!defined(AddOAISet($set_without_name)), 'AddOAISet without "name" field is u
  27.         'spec' => 'specWrong',
  28.         'name' => 'nameWrong',
  29.     };
  30. -    my $setWrong_id = AddOAISet($setWrong);
  31. +    my $setWrong_id;
  32. +    warning_is { $setWrong_id = AddOAISet($setWrong) }
  33. +                'AddOAISet failed',
  34. +                'AddOAISet raises warning if there is a problem with SET spec or SET name';
  35.  
  36. -    DelOAISet($setWrong_id);
  37. +    ok(!defined $setWrong_id, '$setWrong_id is not defined');
  38. }
  39.  
  40. #Adding a Set without description
  41. @@ -197,8 +201,9 @@ my $new_set_without_id =  {
  42.     'name' => 'nameNoSpec',
  43.     'descriptions' => ['descNoSpecNoName'],
  44. };
  45. -ok (!defined(ModOAISet($new_set_without_id)), 'ModOAISet without "id" field is undef');
  46. -
  47. +warning_is { ModOAISet($new_set_without_id) }
  48. +            'Set ID not defined, can\'t modify the set',
  49. +            'ModOAISet raises warning if Set ID is not defined';
  50.  
  51.  my $new_set_without_spec_and_name =  {
  52.      'id' => $set1_id,
  53. @@ -595,10 +600,6 @@ my @setsNotEq = CalcOAISetsBiblio($record);
  54.  is_deeply(@setsNotEq, $setNotVH_id, 'The $record only belongs to $setNotVH');
  55.  
  56.  
  57. -#
  58. -
  59. -
  60. -
  61.  
  62.  # ---------- Subs --------------------------------
  63.  
  64. --
  65. 2.3.3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement