Pārlūkot izejas kodu

Fix #110: map custom statuses where they can be used in overrides

George S. Baugh 9 gadi atpakaļ
vecāks
revīzija
d10a60b635
2 mainītis faili ar 6 papildinājumiem un 4 dzēšanām
  1. 1 0
      Changes
  2. 5 4
      lib/Test/Rail/Parser.pm

+ 1 - 0
Changes

@@ -5,6 +5,7 @@ Revision history for Perl module TestRail::API
     - Add ability to follow POST redirects
     - Don't print stack traces during constructor errors, this can leak auth info into logs
     - Don't override filename in TAP Parser if we already have it
+    - Fix issue where non-standard status overrides were not possible
 
 0.037 2016-08-10 TEODESIAN
     - Fix incorrect POD for TestRail::API::createRunInPlan

+ 5 - 4
lib/Test/Rail/Parser.pm

@@ -192,12 +192,13 @@ sub new {
     confess("No status with internal name 'todo_fail' in TestRail!") unless scalar(@todof);
     confess("No status with internal name 'todo_pass' in TestRail!") unless scalar(@todop);
     confess("No status with internal name 'retest' in TestRail!") unless scalar(@retest);
+    #Map in all the statuses
+    foreach my $status (@{$tropts->{'statuses'}}) {
+        $tropts->{$status->{'name'}} = $status;
+    }
+    #Special aliases
     $tropts->{'ok'}        = $ok[0];
     $tropts->{'not_ok'}    = $not_ok[0];
-    $tropts->{'skip'}      = $skip[0];
-    $tropts->{'todo_fail'} = $todof[0];
-    $tropts->{'todo_pass'} = $todop[0];
-    $tropts->{'retest'}    = $retest[0];
 
     confess "testsuite and testsuite_id are mutually exclusive" if ( $tropts->{'testsuite_id'} && $tropts->{'testsuite'});
     #Grab testsuite by name if needed