Class: Loom::Pattern::ResultReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/loom/pattern/result_reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(loom_config, pattern_slug, hostname, shell_session) ⇒ ResultReporter

Returns a new instance of ResultReporter.



3
4
5
6
7
8
9
10
# File 'lib/loom/pattern/result_reporter.rb', line 3

def initialize(loom_config, pattern_slug, hostname, shell_session)
  @loom_config = loom_config
  @start = Time.now
  @delta_t = nil
  @hostname = hostname
  @pattern_slug = pattern_slug
  @shell_session = shell_session
end

Instance Attribute Details

#hostnameObject (readonly)

Returns the value of attribute hostname.



12
13
14
# File 'lib/loom/pattern/result_reporter.rb', line 12

def hostname
  @hostname
end

Instance Method Details

#failure_summaryObject



14
15
16
17
# File 'lib/loom/pattern/result_reporter.rb', line 14

def failure_summary
  return "scenario did not fail" if success?
  scenario_string
end

#write_reportObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/loom/pattern/result_reporter.rb', line 19

def write_report
  @delta_t = Time.now - @start

  report = generate_report.join "\n\t"
  if success?
    Loom.log.info report
  else
    Loom.log.warn report
  end
end