Module: DaVinciCRDTestKit::TaggedRequestLoadHelper

Constant Summary collapse

ALL_HOOKS =
[
  APPOINTMENT_BOOK_TAG,
  ENCOUNTER_START_TAG,
  ENCOUNTER_DISCHARGE_TAG,
  ORDER_DISPATCH_TAG,
  ORDER_SELECT_TAG,
  ORDER_SIGN_TAG
].freeze

Instance Method Summary collapse

Instance Method Details

#crd_test_groupObject



16
17
18
# File 'lib/davinci_crd_test_kit/client/tagged_request_load_helper.rb', line 16

def crd_test_group
  config.options[:crd_test_group]
end

#hook_nameObject



12
13
14
# File 'lib/davinci_crd_test_kit/client/tagged_request_load_helper.rb', line 12

def hook_name
  config.options[:hook_name]
end

#load_hook_requestsObject



24
25
26
# File 'lib/davinci_crd_test_kit/client/tagged_request_load_helper.rb', line 24

def load_hook_requests
  load_tagged_requests(*tags_to_load)
end

#requests_to_analyzeObject



28
29
30
31
32
33
34
35
36
# File 'lib/davinci_crd_test_kit/client/tagged_request_load_helper.rb', line 28

def requests_to_analyze
  if hook_name.present?
    load_tagged_requests(*tags_to_load)
  else
    ALL_HOOKS.each_with_object([]) do |hook, request_list|
      request_list.concat(load_tagged_requests(*tags_to_load(hook)))
    end
  end
end

#tags_to_load(hook = hook_name) ⇒ Object



20
21
22
# File 'lib/davinci_crd_test_kit/client/tagged_request_load_helper.rb', line 20

def tags_to_load(hook = hook_name)
  crd_test_group.present? ? [crd_test_group] : [hook]
end