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' => "
|
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
|
|
@@ -1,22 +1,28 @@
|
|
1
|
-
# features/support/nagios.rb
|
2
|
-
require 'rubygems'
|
3
|
-
|
4
1
|
module Nagios
|
5
|
-
class NagiosFormatter
|
6
|
-
def initialize(
|
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
|
12
|
-
|
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
|
-
|
16
|
-
|
19
|
+
def visit_steps(steps)
|
20
|
+
super
|
21
|
+
scenario_executed
|
17
22
|
end
|
18
23
|
|
19
|
-
|
24
|
+
private
|
25
|
+
def scenario_executed
|
20
26
|
@total = @failed.size + @passed.size
|
21
27
|
message = ""
|
22
28
|
message += "Critical: #{@failed.size}, "
|