Class: Nagios::NagiosFormatter
- Inherits:
-
Object
- Object
- Nagios::NagiosFormatter
- Defined in:
- lib/generators/project/features/support/nagios.rb
Instance Method Summary collapse
-
#initialize(io, step_mother, options = {}) ⇒ NagiosFormatter
constructor
A new instance of NagiosFormatter.
- #scenario_executed(scenario) ⇒ Object
- #step_failed(step, name, params) ⇒ Object
- #step_passed(step, name, params) ⇒ Object
Constructor Details
#initialize(io, step_mother, options = {}) ⇒ NagiosFormatter
Returns a new instance of NagiosFormatter.
6 7 8 9 |
# File 'lib/generators/project/features/support/nagios.rb', line 6 def initialize(io, step_mother, ={}) @failed = [] @passed = [] end |
Instance Method Details
#scenario_executed(scenario) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/generators/project/features/support/nagios.rb', line 19 def scenario_executed(scenario) @total = @failed.size + @passed.size = "" += "Critical: #{@failed.size}, " += "Warning: 0, " += "#{@passed.size} okay" # nagios performance data += " | passed=#{@passed.size}" += ", failed=#{@failed.size}, total=#{@total}" puts end |
#step_failed(step, name, params) ⇒ Object
15 16 17 |
# File 'lib/generators/project/features/support/nagios.rb', line 15 def step_failed(step, name, params) @failed << step end |
#step_passed(step, name, params) ⇒ Object
11 12 13 |
# File 'lib/generators/project/features/support/nagios.rb', line 11 def step_passed(step, name, params) @passed << step end |