Module: OnlyofficeTestrailWrapper::TestrailStatusHelper

Included in:
TestrailHelper
Defined in:
lib/onlyoffice_testrail_wrapper/testrail_helper/testrail_status_helper.rb

Instance Method Summary collapse

Instance Method Details

#check_status_exist(status) ⇒ Object

check the statuses is exist

Parameters:

  • status (Array)

    with symbols



7
8
9
10
11
12
13
14
15
16
# File 'lib/onlyoffice_testrail_wrapper/testrail_helper/testrail_status_helper.rb', line 7

def check_status_exist(status)
  status = [status] unless status.is_a?(Array)
  status.each do |current_status|
    unless current_status.is_a?(Symbol)
      raise "Founded status '#{current_status}' is a '#{current_status.class}'! " \
            'All statuses must be symbols'
    end
    raise 'One or some statuses is not found. Pls, check it' unless TestrailResult::RESULT_STATUSES.key?(current_status)
  end
end