Class: CaseManager

Inherits:
Object
  • Object
show all
Includes:
Utils, Verbose
Defined in:
lib/teuton/case_manager/case_manager.rb,
lib/teuton/case_manager/report.rb,
lib/teuton/case_manager/check_cases.rb,
lib/teuton/case_manager/hall_of_fame.rb

Overview

  • initialize

  • play

Split into several files:

  • case_manager/check_cases

  • case_manager/export

  • case_manager/hall_of_fame

  • case_manager/report

Defined Under Namespace

Classes: HallOfFame

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Verbose

#verbose, #verboseln

Methods included from Utils

#encode_and_split, #ensure_dir, #my_execute

Constructor Details

#initializeCaseManager

Returns a new instance of CaseManager.



25
26
27
28
29
# File 'lib/teuton/case_manager/case_manager.rb', line 25

def initialize
  @cases = []
  @report = Report.new(0)
  @report.filename = "resume"
end

Instance Attribute Details

#casesObject (readonly)

Returns the value of attribute cases.



23
24
25
# File 'lib/teuton/case_manager/case_manager.rb', line 23

def cases
  @cases
end

#reportObject (readonly)

Returns the value of attribute report.



23
24
25
# File 'lib/teuton/case_manager/case_manager.rb', line 23

def report
  @report
end

Instance Method Details

#export(args = {}) ⇒ Object



43
44
45
46
47
48
49
50
# File 'lib/teuton/case_manager/case_manager.rb', line 43

def export(args = {})
  ExportManager.new.call(
    @report,
    @cases,
    args,
    Project.value[:format]
  )
end

#play(&block) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/teuton/case_manager/case_manager.rb', line 31

def play(&block)
  # Execute "play" order: Start every single case test
  check_cases!
  instance_eval(&block)
  # Run export if user pass option command "--export=json"
  i = Project.value[:options]["export"]
  export(format: i.to_sym) unless i.nil?
  # Accept "configfile" param REVISE There exists?
  i = Project.value[:options]["configfile"]
  export(format: i.to_sym) unless i.nil?
end

#send(args = {}) ⇒ Object



52
53
54
# File 'lib/teuton/case_manager/case_manager.rb', line 52

def send(args = {})
  SendManager.new.call(@cases, args)
end

#show(options = {verbose: 1}) ⇒ Object



56
57
58
# File 'lib/teuton/case_manager/case_manager.rb', line 56

def show(options = {verbose: 1})
  ShowReport.new(@report).call(options[:verbose])
end