Class: Nagios::NagiosFormatter

Inherits:
Cucumber::Ast::Visitor
  • Object
show all
Defined in:
lib/generators/project/features/support/nagios.rb

Instance Method Summary collapse

Constructor Details

#initialize(step_mother, io, options = {}) ⇒ NagiosFormatter

Returns a new instance of NagiosFormatter.



3
4
5
6
7
8
# File 'lib/generators/project/features/support/nagios.rb', line 3

def initialize(step_mother, io, options={})
  super(step_mother)
  @failed  = []
  @passed  = []
  @warning = []
end

Instance Method Details

#visit_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/project/features/support/nagios.rb', line 10

def visit_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
  super
  case status
    when :passed
      @passed << step_match
    when :failed
      @failed << step_match
    when :undefined
      @warning << step_match
  end
end

#visit_steps(steps) ⇒ Object



22
23
24
25
# File 'lib/generators/project/features/support/nagios.rb', line 22

def visit_steps(steps)
  super
  print_summary
end