Sha256: c23c32e4bd53089bdf9a993218434231b16a9bbd58ad517725e6d03c6b36ef32
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
module Nagios class NagiosFormatter < Cucumber::Ast::Visitor def initialize(step_mother, io, options={}) super(step_mother) @failed = [] @passed = [] @warning = [] end 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 def visit_steps(steps) super print_summary end private def print_summary @total = @failed.size + @passed.size + @warning.size message = "" message += "Critical: #{@failed.size}, " message += "Warning: #{@warning.size}, " message += "#{@passed.size} okay" # nagios performance data message += " | passed=#{@passed.size}" message += ", failed=#{@failed.size}" message += ", nosteps=#{@warning.size}" message += ", total=#{@total}" puts message end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
auxesis-cucumber-nagios-0.4.3 | lib/generators/project/features/support/nagios.rb |
auxesis-cucumber-nagios-0.4.4 | lib/generators/project/features/support/nagios.rb |