cucumber-nagios 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS CHANGED
@@ -7,7 +7,7 @@ Contributors
7
7
  ------------
8
8
 
9
9
  Morgan Christiansson <morgan@mog.se>
10
- Martin Englund <martin.englund@sun.com>
10
+ Martin Englund <martin@englund.nu>
11
11
  Adam Jacob <adam@opscode.com>
12
12
  Juri Rischel Jensen <juri@fab-it.dk>
13
13
  Gareth Rushgrove <gareth@morethanseven.net>
@@ -10,7 +10,7 @@ module Cucumber
10
10
  @warning = []
11
11
  @io = io
12
12
  end
13
-
13
+
14
14
  def after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
15
15
  record_result(status, :step_match => step_match)
16
16
  end
@@ -20,7 +20,7 @@ module Cucumber
20
20
  end
21
21
 
22
22
  def after_table_row(table_row)
23
- unless @header_row
23
+ unless @header_row
24
24
  record_result(table_row.status) if table_row.respond_to?(:status)
25
25
  end
26
26
  @header_row = false if @header_row
@@ -29,24 +29,22 @@ module Cucumber
29
29
  def after_features(steps)
30
30
  print_summary
31
31
  end
32
-
32
+
33
33
  private
34
34
  def print_summary
35
35
  @total = @failed.size + @passed.size + @warning.size
36
- message = ""
37
- message += "Critical: #{@failed.size}, "
38
- message += "Warning: #{@warning.size}, "
39
- message += "#{@passed.size} okay"
40
- # nagios performance data
41
- message += " | passed=#{@passed.size}"
42
- message += ", failed=#{@failed.size}"
43
- message += ", nosteps=#{@warning.size}"
44
- message += ", total=#{@total}\n"
36
+ @status = @failed.size > 0 && "CRITICAL" || @warning.size > 0 && "WARNING" || "OK"
37
+
38
+ service_output = [ "CUCUMBER #{@status} - Critical: #{@failed.size}",
39
+ "Warning: #{@warning.size}", "#{@passed.size} okay" ]
40
+ performance_data = [ "passed=#{@passed.size}", "failed=#{@failed.size}",
41
+ "nosteps=#{@warning.size}", "total=#{@total}" ]
42
+ message = "#{service_output.join(', ')} | #{performance_data.join('; ')}\n"
45
43
 
46
44
  @io.print(message)
47
45
  @io.flush
48
46
  end
49
-
47
+
50
48
  def record_result(status, opts={})
51
49
  step_match = opts[:step_match] || true
52
50
  case status
@@ -1,6 +1,6 @@
1
1
  # list of dependencies for a cucumber-nagios project
2
2
 
3
- gem "cucumber-nagios", "0.7.0"
3
+ gem "cucumber-nagios"
4
4
  gem "cucumber", "0.6.1"
5
5
  gem "rspec", "1.3.0"
6
6
  gem "webrat", "0.7.0"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 3
9
- version: 0.7.3
8
+ - 4
9
+ version: 0.7.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Lindsay Holmwood