cucumber-nagios 0.8.6 → 0.8.7

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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cucumber-nagios}
8
- s.version = "0.8.6"
8
+ s.version = "0.8.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Lindsay Holmwood"]
@@ -33,3 +33,10 @@ Then /^"([^"]*)" in the "([^"]*)" project should not exist$/ do |file, project_n
33
33
  filename = File.join(file, project_name)
34
34
  File.exists?(filename).should be_false
35
35
  end
36
+
37
+ Then /^the "([^"]*)" feature on "([^"]*)" should produce multiline output$/ do |feature, site|
38
+ @output = `cd /tmp/#{@project_name} ; bin/cucumber-nagios features/#{site}/#{feature}.feature`
39
+ $?.exitstatus.should == 0
40
+
41
+ @output.split("\n").size.should > 1
42
+ end
@@ -31,3 +31,10 @@ Feature: Using features
31
31
  When I generate a new feature called "homepage" for "github.com"
32
32
  Then the "homepage" feature on "github.com" should exit cleanly
33
33
  Then "webrat.log" in the "passing-features" project should not exist
34
+
35
+ @using
36
+ Scenario: Multiline output
37
+ Given a project called "multiline-output" is created and frozen
38
+ When I generate a new feature called "homepage" for "github.com"
39
+ Then the "homepage" feature on "github.com" should exit cleanly
40
+ And the "homepage" feature on "github.com" should produce multiline output
@@ -9,11 +9,12 @@ module Cucumber
9
9
  @passed = []
10
10
  @warning = []
11
11
  @io = io
12
+ @message = []
12
13
  @start_time = Time.now
13
14
  end
14
15
 
15
16
  def after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
16
- record_result(status, :step_match => step_match)
17
+ record_result(status, :step_match => step_match, :keyword => keyword)
17
18
  end
18
19
 
19
20
  def before_examples(*args)
@@ -42,21 +43,27 @@ module Cucumber
42
43
  performance_data = [ "passed=#{@passed.size}", "failed=#{@failed.size}",
43
44
  "nosteps=#{@warning.size}", "total=#{@total}",
44
45
  "time=#{@run_time}" ]
45
- message = "#{service_output.join(', ')} | #{performance_data.join('; ')}\n"
46
+ @message << "#{service_output.join(', ')} | #{performance_data.join('; ')}"
46
47
 
48
+ @failed.each do |keyword, step_match|
49
+ @message << "Failed: #{keyword}#{step_match.instance_variable_get("@name_to_match")} in #{step_match.file_colon_line}"
50
+ end
51
+
52
+ message = @message.join("\n") + "\n"
47
53
  @io.print(message)
48
54
  @io.flush
49
55
  end
50
56
 
51
57
  def record_result(status, opts={})
52
58
  step_match = opts[:step_match] || true
59
+ keyword = opts[:keyword]
53
60
  case status
54
61
  when :passed
55
- @passed << step_match
62
+ @passed << [ keyword, step_match ]
56
63
  when :failed
57
- @failed << step_match
64
+ @failed << [ keyword, step_match ]
58
65
  when :undefined
59
- @warning << step_match
66
+ @warning << [ keyword, step_match ]
60
67
  end
61
68
  end
62
69
 
@@ -1,5 +1,5 @@
1
1
  module Cucumber
2
2
  module Nagios
3
- VERSION = '0.8.6'
3
+ VERSION = '0.8.7'
4
4
  end
5
5
  end
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ require 'rubygems'
4
+ require 'bundler/setup'
3
5
  require 'pathname'
4
6
 
5
7
  unless ARGV[0]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-nagios
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 49
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 6
10
- version: 0.8.6
9
+ - 7
10
+ version: 0.8.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lindsay Holmwood