auxesis-cucumber-nagios 0.3.8 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,10 +19,10 @@ end
19
19
  desc "freeze deps"
20
20
  task :deps do
21
21
 
22
- deps = {'cucumber' => "= 0.1.16",
22
+ deps = {'cucumber' => "~> 0.3.0",
23
+ 'rspec' => "~> 1.2.4",
23
24
  'webrat' => ">= 0.4.2",
24
- 'mechanize' => ">= 0.9.1",
25
- 'rspec' => ">= 1.1.12"}
25
+ 'mechanize' => ">= 0.9.1"}
26
26
 
27
27
  puts "\ninstalling dependencies. this will take a few minutes."
28
28
 
@@ -7,5 +7,5 @@ rescue LoadError
7
7
  require 'bin/common'
8
8
  end
9
9
 
10
- require 'cucumber/cli'
11
- Cucumber::CLI.execute(ARGV)
10
+ require 'cucumber/cli/main'
11
+ Cucumber::Cli::Main.execute(ARGV)
@@ -1,22 +1,28 @@
1
- # features/support/nagios.rb
2
- require 'rubygems'
3
-
4
1
  module Nagios
5
- class NagiosFormatter
6
- def initialize(io, step_mother, options={})
2
+ class NagiosFormatter < Cucumber::Ast::Visitor
3
+ def initialize(step_mother, io, options={})
4
+ super(step_mother)
7
5
  @failed = []
8
6
  @passed = []
9
7
  end
10
8
 
11
- def step_passed(step, name, params)
12
- @passed << step
9
+ def visit_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
10
+ super
11
+ name = "#{keyword} #{step_match.step_name}"
12
+ case status
13
+ when :passed
14
+ @passed << name
15
+ when :failed
16
+ @failed << name
17
+ end
13
18
  end
14
-
15
- def step_failed(step, name, params)
16
- @failed << step
19
+ def visit_steps(steps)
20
+ super
21
+ scenario_executed
17
22
  end
18
23
 
19
- def scenario_executed(scenario)
24
+ private
25
+ def scenario_executed
20
26
  @total = @failed.size + @passed.size
21
27
  message = ""
22
28
  message += "Critical: #{@failed.size}, "
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auxesis-cucumber-nagios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindsay Holmwood