cucumber-nagios 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
data/cucumber-nagios.gemspec
CHANGED
@@ -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
|
data/features/using.feature
CHANGED
@@ -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
|
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
|
62
|
+
@passed << [ keyword, step_match ]
|
56
63
|
when :failed
|
57
|
-
|
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
|
|
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:
|
4
|
+
hash: 49
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 7
|
10
|
+
version: 0.8.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lindsay Holmwood
|