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:

  • check_cases

  • export_manager

  • send_manager

  • show_report

Defined Under Namespace

Classes: HallOfFame

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Verbose

#verbose, #verboseln

Methods included from Utils

#ensure_dir

Constructor Details

#initializeCaseManager

Returns a new instance of CaseManager.



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

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

Instance Attribute Details

#casesObject (readonly)

Returns the value of attribute cases.



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

def cases
  @cases
end

#reportObject (readonly)

Returns the value of attribute report.



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

def report
  @report
end

Instance Method Details

#export(args = {}) ⇒ Object



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

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

#play(&block) ⇒ Object



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

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



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

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

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



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

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