specjour 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.dev +3 -0
- data/History.markdown +6 -0
- data/VERSION +1 -1
- data/lib/specjour/cucumber/distributed_formatter.rb +30 -1
- data/lib/specjour/cucumber/final_report.rb +7 -3
- data/lib/specjour.rb +1 -1
- metadata +4 -3
data/.dev
ADDED
data/History.markdown
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -10,6 +10,7 @@ module Specjour::Cucumber
|
|
10
10
|
@io = io
|
11
11
|
@options = options
|
12
12
|
@failing_scenarios = []
|
13
|
+
@step_summary = []
|
13
14
|
end
|
14
15
|
|
15
16
|
def after_features(features)
|
@@ -31,8 +32,36 @@ module Specjour::Cucumber
|
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
35
|
+
def prepare_elements(elements, status, kind)
|
36
|
+
output = ''
|
37
|
+
if elements.any?
|
38
|
+
output += format_string("\n(::) #{status} #{kind} (::)\n", status)
|
39
|
+
output += "\n"
|
40
|
+
end
|
41
|
+
|
42
|
+
elements.each_with_index do |element, i|
|
43
|
+
if status == :failed
|
44
|
+
output += print_exception(element.exception, status, 0)
|
45
|
+
else
|
46
|
+
output += format_string(element.backtrace_line, status)
|
47
|
+
output += "\n"
|
48
|
+
end
|
49
|
+
@step_summary << output unless output.blank?
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def prepare_steps(type)
|
54
|
+
prepare_elements(step_mother.scenarios(type), type, 'steps')
|
55
|
+
end
|
56
|
+
|
57
|
+
def print_exception(e, status, indent)
|
58
|
+
format_string("#{e.message} (#{e.class})\n#{e.backtrace.join("\n")}".indent(indent), status)
|
59
|
+
end
|
60
|
+
|
34
61
|
def print_summary
|
35
62
|
prepare_failures
|
63
|
+
prepare_steps(:failed)
|
64
|
+
prepare_steps(:undefined)
|
36
65
|
|
37
66
|
@io.send_message(:worker_summary=, to_hash)
|
38
67
|
end
|
@@ -47,7 +76,7 @@ module Specjour::Cucumber
|
|
47
76
|
hash[type][outcome] = step_mother.send(type, outcome).size
|
48
77
|
end
|
49
78
|
end
|
50
|
-
hash.merge!(:failing_scenarios => @failing_scenarios)
|
79
|
+
hash.merge!(:failing_scenarios => @failing_scenarios, :step_summary => @step_summary)
|
51
80
|
hash
|
52
81
|
end
|
53
82
|
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module Specjour
|
2
2
|
module Cucumber
|
3
3
|
class Summarizer
|
4
|
-
attr_reader :duration, :failing_scenarios
|
4
|
+
attr_reader :duration, :failing_scenarios, :step_summary
|
5
5
|
def initialize
|
6
6
|
@duration = 0.0
|
7
7
|
@failing_scenarios = []
|
8
|
+
@step_summary = []
|
8
9
|
@scenarios = Hash.new(0)
|
9
10
|
@steps = Hash.new(0)
|
10
11
|
end
|
@@ -18,6 +19,8 @@ module Specjour
|
|
18
19
|
stats.each do |category, hash|
|
19
20
|
if category == :failing_scenarios
|
20
21
|
@failing_scenarios += hash
|
22
|
+
elsif category == :step_summary
|
23
|
+
@step_summary += hash
|
21
24
|
elsif category == :duration
|
22
25
|
@duration = hash.to_f if duration < hash.to_f
|
23
26
|
else
|
@@ -54,8 +57,9 @@ module Specjour
|
|
54
57
|
|
55
58
|
def summarize
|
56
59
|
if @summarizer.failing_scenarios.any?
|
57
|
-
puts
|
58
|
-
puts
|
60
|
+
puts "\n\n"
|
61
|
+
@summarizer.step_summary.each {|f| puts f }
|
62
|
+
puts "\n\n"
|
59
63
|
puts format_string("Failing Scenarios:", :failed)
|
60
64
|
@summarizer.failing_scenarios.each {|f| puts f }
|
61
65
|
end
|
data/lib/specjour.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 2
|
9
|
+
version: 0.2.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Sandro Turriate
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-22 00:00:00 -04:00
|
18
18
|
default_executable: specjour
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -80,6 +80,7 @@ extensions: []
|
|
80
80
|
extra_rdoc_files:
|
81
81
|
- README.markdown
|
82
82
|
files:
|
83
|
+
- .dev
|
83
84
|
- .document
|
84
85
|
- .gitignore
|
85
86
|
- History.markdown
|