spinach-console-reporter 0.0.1
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.
- data/.gitignore +19 -0
- data/.rspec +2 -0
- data/.rvmrc.template +1 -0
- data/Gemfile +4 -0
- data/Guardfile +11 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +3 -0
- data/lib/spinach-console-reporter.rb +2 -0
- data/lib/spinach-console-reporter/error_reporting.rb +168 -0
- data/lib/spinach-console-reporter/gem_description.rb +17 -0
- data/lib/spinach-console-reporter/out.rb +276 -0
- data/spec/spec_helper.rb +24 -0
- data/spinach-console-reporter.gemspec +27 -0
- data/tasks/ci.rake +24 -0
- metadata +192 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rvmrc.template
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.9.3@spinach-console-reporter
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
guard 'spork' do
|
2
|
+
watch('Gemfile')
|
3
|
+
watch('Gemfile.lock')
|
4
|
+
watch('spec/spec_helper.rb') { :rspec }
|
5
|
+
end
|
6
|
+
|
7
|
+
guard 'rspec', :all_after_pass => false, :cli => "--color --format documentation --drb" do
|
8
|
+
watch(%r{^spec/.+_spec\.rb$})
|
9
|
+
watch(%r{^lib/(.+)/(.+)\.rb$}) { |m| [ "lib/#{m[1]}/#{m[2]}.rb", "spec/#{m[1]}/#{m[2]}_spec.rb" ] }
|
10
|
+
watch('spec/spec_helper.rb') { "spec" }
|
11
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Yi Wen
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Spinach::Console::Reporter
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'spinach-console-reporter'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install spinach-console-reporter
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
module Spinach
|
2
|
+
class Reporter
|
3
|
+
# This module handles Stdout's reporter error reporting capabilities.
|
4
|
+
module ErrorReporting
|
5
|
+
|
6
|
+
# Prints the errors for this run.
|
7
|
+
#
|
8
|
+
def error_summary
|
9
|
+
error.puts "\nError summary:\n"
|
10
|
+
report_error_steps
|
11
|
+
report_failed_steps
|
12
|
+
report_undefined_features
|
13
|
+
report_undefined_steps
|
14
|
+
report_pending_steps
|
15
|
+
end
|
16
|
+
|
17
|
+
def report_error_steps
|
18
|
+
report_errors('Errors', error_steps, :red) if error_steps.any?
|
19
|
+
end
|
20
|
+
|
21
|
+
def report_failed_steps
|
22
|
+
report_errors('Failures', failed_steps, :red) if failed_steps.any?
|
23
|
+
end
|
24
|
+
|
25
|
+
def report_undefined_steps
|
26
|
+
report_errors('Undefined steps', undefined_steps, :yellow) if undefined_steps.any?
|
27
|
+
end
|
28
|
+
|
29
|
+
def report_pending_steps
|
30
|
+
report_errors('Pending steps', pending_steps, :yellow) if pending_steps.any?
|
31
|
+
end
|
32
|
+
|
33
|
+
def report_undefined_features
|
34
|
+
if undefined_features.any?
|
35
|
+
error.puts " Undefined features (#{undefined_features.length})".light_yellow
|
36
|
+
undefined_features.each do |feature|
|
37
|
+
error.puts " #{feature.name}".yellow
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Prints the error for a given set of steps
|
43
|
+
#
|
44
|
+
# @param [String] banner
|
45
|
+
# the text to prepend as the title
|
46
|
+
#
|
47
|
+
# @param [Array] steps
|
48
|
+
# the steps to output
|
49
|
+
#
|
50
|
+
# @param [Symbol] color
|
51
|
+
# The color code to use with Colorize to colorize the output.
|
52
|
+
#
|
53
|
+
def report_errors(banner, steps, color)
|
54
|
+
error.puts send(color, " #{banner} (#{steps.length})")
|
55
|
+
steps.each do |error|
|
56
|
+
report_error error
|
57
|
+
end
|
58
|
+
error.puts ""
|
59
|
+
end
|
60
|
+
|
61
|
+
# Prints an error in a nice format
|
62
|
+
#
|
63
|
+
# @param [Array] error
|
64
|
+
# An array containing the feature, scenario, step and exception
|
65
|
+
#
|
66
|
+
# @param [Symbol] format
|
67
|
+
# The format to output the error. Currently supproted formats are
|
68
|
+
# :summarized (default) and :full
|
69
|
+
#
|
70
|
+
# @return [String]
|
71
|
+
# The error report
|
72
|
+
#
|
73
|
+
def report_error(error, format=:summarized)
|
74
|
+
case format
|
75
|
+
when :summarized
|
76
|
+
self.error.puts summarized_error(error)
|
77
|
+
when :full
|
78
|
+
self.error.puts full_error(error)
|
79
|
+
else
|
80
|
+
raise "Format not defined"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Returns summarized error report
|
85
|
+
#
|
86
|
+
# @param [Array] error
|
87
|
+
# An array containing the feature, scenario, step and exception
|
88
|
+
#
|
89
|
+
# @return [String]
|
90
|
+
# The summarized error report
|
91
|
+
#
|
92
|
+
def summarized_error(error)
|
93
|
+
feature, scenario, step, exception = error
|
94
|
+
summary = " #{feature.name} :: #{scenario.name} :: #{full_step step}"
|
95
|
+
if exception.kind_of?(Spinach::StepNotDefinedException)
|
96
|
+
summary.yellow
|
97
|
+
elsif exception.kind_of?(Spinach::StepPendingException)
|
98
|
+
summary += "\n Reason: '#{exception.reason}'\n"
|
99
|
+
yellow(summary)
|
100
|
+
else
|
101
|
+
red(summary)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# Returns a complete error report
|
106
|
+
#
|
107
|
+
# @param [Array] error
|
108
|
+
# An array containing the feature, scenario, step and exception
|
109
|
+
#
|
110
|
+
# @return [String]
|
111
|
+
# The coplete error report
|
112
|
+
#
|
113
|
+
def full_error(error)
|
114
|
+
feature, scenario, step, exception = error
|
115
|
+
output = "\n"
|
116
|
+
output += report_exception(exception)
|
117
|
+
output +="\n"
|
118
|
+
|
119
|
+
if exception.kind_of?(Spinach::StepNotDefinedException)
|
120
|
+
output << "\n"
|
121
|
+
output << " You can define it with: \n\n".yellow
|
122
|
+
suggestion = Generators::StepGenerator.new(step).generate
|
123
|
+
suggestion.split("\n").each do |line|
|
124
|
+
output << " #{line}\n".yellow
|
125
|
+
end
|
126
|
+
output << "\n"
|
127
|
+
elsif exception.kind_of?(Spinach::StepPendingException)
|
128
|
+
output << yellow(" Reason: '#{exception.reason}'")
|
129
|
+
output << "\n"
|
130
|
+
else
|
131
|
+
if options[:backtrace]
|
132
|
+
output += "\n"
|
133
|
+
exception.backtrace.map do |line|
|
134
|
+
output << " #{line}\n"
|
135
|
+
end
|
136
|
+
else
|
137
|
+
output << " #{exception.backtrace[0]}"
|
138
|
+
end
|
139
|
+
end
|
140
|
+
output
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
# Prints a information when an exception is raised.
|
145
|
+
#
|
146
|
+
# @param [Exception] exception
|
147
|
+
# The exception to report
|
148
|
+
#
|
149
|
+
# @return [String]
|
150
|
+
# The exception report
|
151
|
+
#
|
152
|
+
def report_exception(exception)
|
153
|
+
output = exception.message.split("\n").map{ |line|
|
154
|
+
" #{line}"
|
155
|
+
}.join("\n")
|
156
|
+
|
157
|
+
if exception.kind_of?(Spinach::StepNotDefinedException)
|
158
|
+
output.yellow
|
159
|
+
elsif exception.kind_of?(Spinach::StepPendingException)
|
160
|
+
output.yellow
|
161
|
+
else
|
162
|
+
output.red
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Spinach
|
2
|
+
module Console
|
3
|
+
module Reporter
|
4
|
+
module GemDescription
|
5
|
+
class << self
|
6
|
+
def to_s
|
7
|
+
<<-EOF
|
8
|
+
This is a console reporter for spinach. It works with Jenkins console ANSI
|
9
|
+
color output plugin (https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin)
|
10
|
+
to output colorfully in Jenkins.
|
11
|
+
EOF
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,276 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Spinach
|
3
|
+
module Console
|
4
|
+
module Reporter
|
5
|
+
class Out < Spinach::Reporter
|
6
|
+
include ErrorReporting
|
7
|
+
|
8
|
+
# The output buffers to store the reports.
|
9
|
+
attr_reader :out, :error
|
10
|
+
|
11
|
+
# The last scenario error
|
12
|
+
attr_accessor :scenario_error
|
13
|
+
|
14
|
+
# The last scenario
|
15
|
+
attr_accessor :scenario
|
16
|
+
|
17
|
+
# Initialitzes the runner
|
18
|
+
#
|
19
|
+
# @param [Hash] options
|
20
|
+
# Sets a custom output buffer by setting options[:output]
|
21
|
+
# Sets a custom error buffer by setting options[:error]
|
22
|
+
#
|
23
|
+
def initialize(*args)
|
24
|
+
super(*args)
|
25
|
+
@out = options[:output] || $stdout
|
26
|
+
@error = options[:error] || $stdout
|
27
|
+
@max_step_name_length = 0
|
28
|
+
end
|
29
|
+
|
30
|
+
# Prints the feature name to the standard output
|
31
|
+
#
|
32
|
+
# @param [Hash] data
|
33
|
+
# The feature in a JSON Gherkin format
|
34
|
+
#
|
35
|
+
def before_feature_run(feature)
|
36
|
+
name = feature.name
|
37
|
+
out.puts %Q|\n#{magenta("Feature:")} #{magenta(name)}|
|
38
|
+
end
|
39
|
+
|
40
|
+
# Prints the scenario name to the standard ouput
|
41
|
+
#
|
42
|
+
# @param [Hash] data
|
43
|
+
# The feature in a JSON Gherkin format
|
44
|
+
#
|
45
|
+
def before_scenario_run(scenario, step_definitions = nil)
|
46
|
+
@max_step_name_length = scenario.steps.map(&:name).map(&:length).max if scenario.steps.any?
|
47
|
+
name = scenario.name
|
48
|
+
out.puts "\n #{green('Scenario:')} #{green(name)}"
|
49
|
+
end
|
50
|
+
|
51
|
+
# Adds an error report and re
|
52
|
+
#
|
53
|
+
# @param [Hash] data
|
54
|
+
# The feature in a JSON Gherkin format
|
55
|
+
#
|
56
|
+
def after_scenario_run(scenario, step_definitions = nil)
|
57
|
+
if scenario_error
|
58
|
+
report_error(scenario_error, :full)
|
59
|
+
self.scenario_error = nil
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Adds a passed step to the output buffer.
|
64
|
+
#
|
65
|
+
# @param [Step] step
|
66
|
+
# The step.
|
67
|
+
#
|
68
|
+
# @param [Array] step_location
|
69
|
+
# The step source location
|
70
|
+
#
|
71
|
+
def on_successful_step(step, step_location, step_definitions = nil)
|
72
|
+
output_step('✔', step, :green, step_location)
|
73
|
+
self.scenario = [current_feature, current_scenario, step]
|
74
|
+
successful_steps << scenario
|
75
|
+
end
|
76
|
+
|
77
|
+
# Adds a failing step to the output buffer.
|
78
|
+
#
|
79
|
+
# @param [Hash] step
|
80
|
+
# The step in a JSON Gherkin format
|
81
|
+
#
|
82
|
+
# @param [Exception] failure
|
83
|
+
# The exception that caused the failure
|
84
|
+
#
|
85
|
+
def on_failed_step(step, failure, step_location, step_definitions = nil)
|
86
|
+
output_step('✘', step, :red, step_location)
|
87
|
+
self.scenario_error = [current_feature, current_scenario, step, failure]
|
88
|
+
failed_steps << scenario_error
|
89
|
+
end
|
90
|
+
|
91
|
+
# Adds a step that has raised an error to the output buffer.
|
92
|
+
#
|
93
|
+
# @param [Hash] step
|
94
|
+
# The step in a JSON Gherkin format
|
95
|
+
#
|
96
|
+
# @param [Exception] failure
|
97
|
+
# The exception that caused the failure
|
98
|
+
#
|
99
|
+
def on_error_step(step, failure, step_location, step_definitions = nil)
|
100
|
+
output_step('!', step, :red, step_location)
|
101
|
+
self.scenario_error = [current_feature, current_scenario, step, failure]
|
102
|
+
error_steps << scenario_error
|
103
|
+
end
|
104
|
+
|
105
|
+
# Adds an undefined step to the output buffer.
|
106
|
+
#
|
107
|
+
# @param [Hash] step
|
108
|
+
# The step in a JSON Gherkin format
|
109
|
+
#
|
110
|
+
def on_undefined_step(step, failure, step_definitions = nil)
|
111
|
+
output_step('?', step, :yellow)
|
112
|
+
self.scenario_error = [current_feature, current_scenario, step, failure]
|
113
|
+
undefined_steps << scenario_error
|
114
|
+
end
|
115
|
+
|
116
|
+
# Adds an undefined step to the output buffer.
|
117
|
+
#
|
118
|
+
# @param [Hash] step
|
119
|
+
# The step in a JSON Gherkin format
|
120
|
+
#
|
121
|
+
def on_pending_step(step, failure)
|
122
|
+
output_step('P', step, :yellow)
|
123
|
+
self.scenario_error = [current_feature, current_scenario, step, failure]
|
124
|
+
pending_steps << scenario_error
|
125
|
+
end
|
126
|
+
|
127
|
+
# Adds a feature not found message to the output buffer.
|
128
|
+
#
|
129
|
+
# @param [Hash] feature
|
130
|
+
# the feature in a json gherkin format
|
131
|
+
#
|
132
|
+
# @param [Spinach::FeatureNotFoundException] exception
|
133
|
+
# the related exception
|
134
|
+
#
|
135
|
+
def on_feature_not_found(feature)
|
136
|
+
generator = Generators::FeatureGenerator.new(feature)
|
137
|
+
lines = "Could not find steps for `#{feature.name}` feature\n\n"
|
138
|
+
lines << "\nPlease create the file #{generator.filename} at #{generator.path}, with:\n\n"
|
139
|
+
|
140
|
+
lines << generator.generate
|
141
|
+
|
142
|
+
lines.split("\n").each do |line|
|
143
|
+
out.puts " #{line}".yellow
|
144
|
+
end
|
145
|
+
out.puts "\n\n"
|
146
|
+
|
147
|
+
undefined_features << feature
|
148
|
+
end
|
149
|
+
|
150
|
+
# Adds a step that has been skipped to the output buffer.
|
151
|
+
#
|
152
|
+
# @param [Hash] step
|
153
|
+
# The step that Gherkin extracts
|
154
|
+
#
|
155
|
+
def on_skipped_step(step, step_definitions = nil)
|
156
|
+
output_step('~', step, :cyan)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Adds to the output buffer a step result
|
160
|
+
#
|
161
|
+
# @param [String] symbol
|
162
|
+
# A symbol to prepend before the step keyword (might be useful to
|
163
|
+
# indicate if everything went ok or not).
|
164
|
+
#
|
165
|
+
# @param [Hash] step
|
166
|
+
# The step in a JSON Gherkin format
|
167
|
+
#
|
168
|
+
# @param [Symbol] color
|
169
|
+
# The color code to use with Colorize to colorize the output.
|
170
|
+
#
|
171
|
+
# @param [Array] step_location
|
172
|
+
# step source location and file line
|
173
|
+
#
|
174
|
+
def output_step(symbol, step, color, step_location = nil)
|
175
|
+
step_location = step_location.first.gsub("#{File.expand_path('.')}/", '# ')+":#{step_location.last.to_s}" if step_location
|
176
|
+
max_length = @max_step_name_length + 30 # Colorize and output format correction
|
177
|
+
|
178
|
+
# REMEMBER TO CORRECT PREVIOUS MAX LENGTH IF OUTPUT FORMAT IS MODIFIED
|
179
|
+
buffer = []
|
180
|
+
buffer << indent(4)
|
181
|
+
# buffer << symbol.foreground(color).bright
|
182
|
+
buffer << indent(2)
|
183
|
+
buffer << send(color, step.keyword)
|
184
|
+
buffer << indent(1)
|
185
|
+
buffer << send(color, step.name)
|
186
|
+
joined = buffer.join.ljust(max_length)
|
187
|
+
|
188
|
+
out.puts(joined + white(step_location.to_s))
|
189
|
+
end
|
190
|
+
|
191
|
+
# It prints the error summary if the run has failed
|
192
|
+
# It always print feature success summary
|
193
|
+
#
|
194
|
+
# @param [True,False] success
|
195
|
+
# whether the run has succeed or not
|
196
|
+
#
|
197
|
+
def after_run(success)
|
198
|
+
error_summary unless success
|
199
|
+
out.puts ""
|
200
|
+
run_summary
|
201
|
+
end
|
202
|
+
|
203
|
+
# Prints the feature success summary for this run.
|
204
|
+
#
|
205
|
+
def run_summary
|
206
|
+
successful_summary = format_summary(:green, successful_steps, 'Successful')
|
207
|
+
undefined_summary = format_summary(:yellow, undefined_steps, 'Undefined')
|
208
|
+
pending_summary = format_summary(:yellow, pending_steps, 'Pending')
|
209
|
+
failed_summary = format_summary(:red, failed_steps, 'Failed')
|
210
|
+
error_summary = format_summary(:red, error_steps, 'Error')
|
211
|
+
|
212
|
+
out.puts "Steps Summary: #{successful_summary}, #{undefined_summary}, #{pending_summary}, #{failed_summary}, #{error_summary}\n\n"
|
213
|
+
end
|
214
|
+
|
215
|
+
# Constructs the full step definition
|
216
|
+
#
|
217
|
+
# @param [Hash] step
|
218
|
+
# The step.
|
219
|
+
#
|
220
|
+
def full_step(step)
|
221
|
+
"#{step.keyword} #{step.name}"
|
222
|
+
end
|
223
|
+
|
224
|
+
private
|
225
|
+
|
226
|
+
def indent(n = 1)
|
227
|
+
" " * n
|
228
|
+
end
|
229
|
+
|
230
|
+
def format_summary(color, steps, message)
|
231
|
+
buffer = []
|
232
|
+
buffer << "(".colorize(color)
|
233
|
+
buffer << steps.length.to_s.colorize(:"light_#{color}")
|
234
|
+
buffer << ") ".colorize(color)
|
235
|
+
buffer << message.colorize(color)
|
236
|
+
buffer.join
|
237
|
+
end
|
238
|
+
def color(text, color_code)
|
239
|
+
"#{color_code}#{text}\e[0m"
|
240
|
+
end
|
241
|
+
|
242
|
+
def bold(text)
|
243
|
+
color(text, "\e[1m")
|
244
|
+
end
|
245
|
+
|
246
|
+
def red(text)
|
247
|
+
color(text, "\e[31m")
|
248
|
+
end
|
249
|
+
|
250
|
+
def green(text)
|
251
|
+
color(text, "\e[32m")
|
252
|
+
end
|
253
|
+
|
254
|
+
def yellow(text)
|
255
|
+
color(text, "\e[33m")
|
256
|
+
end
|
257
|
+
|
258
|
+
def blue(text)
|
259
|
+
color(text, "\e[34m")
|
260
|
+
end
|
261
|
+
|
262
|
+
def magenta(text)
|
263
|
+
color(text, "\e[35m")
|
264
|
+
end
|
265
|
+
|
266
|
+
def cyan(text)
|
267
|
+
color(text, "\e[36m")
|
268
|
+
end
|
269
|
+
|
270
|
+
def white(text)
|
271
|
+
color(text, "\e[37m")
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.start do
|
3
|
+
SimpleCov.refuse_coverage_drop
|
4
|
+
SimpleCov.minimum_coverage 100
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'spork'
|
8
|
+
require 'guard/spork'
|
9
|
+
|
10
|
+
Spork.prefork do
|
11
|
+
require 'rspec/core'
|
12
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
13
|
+
require "#{File.dirname(__FILE__)}/../lib/spinach-console-reporter"
|
14
|
+
|
15
|
+
RSpec.configure do |config|
|
16
|
+
config.mock_with :rspec
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
Spork.each_run do
|
21
|
+
load "#{File.dirname(__FILE__)}/../lib/spinach-console-reporter.rb"
|
22
|
+
Dir["#{File.dirname(__FILE__)}/../lib/spinach-console-reporter/*.rb"].each {|f| load f}
|
23
|
+
end
|
24
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
$:.push File.expand_path("../lib", __FILE__)
|
4
|
+
require "spinach-console-reporter/gem_description"
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.authors = ["Yi Wen"]
|
8
|
+
gem.email = ["ywen.github@gmail.com"]
|
9
|
+
gem.description = Spinach::Console::Reporter::GemDescription.to_s
|
10
|
+
gem.summary = %q{A console reporter for spinach}
|
11
|
+
gem.homepage = "https://github.com/ywen/spinach-console-reporter"
|
12
|
+
|
13
|
+
gem.files = `git ls-files`.split($\)
|
14
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
gem.name = "spinach-console-reporter"
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
gem.version = "0.0.1"
|
19
|
+
gem.add_runtime_dependency(%q<spinach>)
|
20
|
+
gem.add_development_dependency(%q<rspec>)
|
21
|
+
gem.add_development_dependency(%q<rake>)
|
22
|
+
gem.add_development_dependency(%q<guard-spork>)
|
23
|
+
gem.add_development_dependency(%q<guard-rspec>)
|
24
|
+
gem.add_development_dependency(%q<cane>)
|
25
|
+
gem.add_development_dependency(%q<simplecov>)
|
26
|
+
gem.add_development_dependency(%q<growl-rspec>)
|
27
|
+
end
|
data/tasks/ci.rake
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
begin
|
2
|
+
require 'rspec/core'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
require 'cane/rake_task'
|
6
|
+
task :ci => [
|
7
|
+
'cruise_spec',
|
8
|
+
'quality'
|
9
|
+
]
|
10
|
+
|
11
|
+
desc "Run cane to check quality metrics"
|
12
|
+
Cane::RakeTask.new(:quality) do |cane|
|
13
|
+
cane.abc_max = 10
|
14
|
+
cane.no_doc = true
|
15
|
+
end
|
16
|
+
desc "Run all specs in spec directory (excluding plugin specs)"
|
17
|
+
RSpec::Core::RakeTask.new(:cruise_spec) do |t|
|
18
|
+
out = File.join(File.expand_path(File.dirname(__FILE__)), "..","test_reports/Rspec.html")
|
19
|
+
t.rspec_opts = ["--format", "html", "-o", out, "--format", "progress"]
|
20
|
+
excluded_paths = ['bundle', 'spec', 'config/boot.rb', '/var/', '/usr']
|
21
|
+
t.pattern = "spec/**/*_spec.rb"
|
22
|
+
end
|
23
|
+
rescue LoadError => e
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spinach-console-reporter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Yi Wen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-05 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: spinach
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: guard-spork
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: guard-rspec
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: cane
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: simplecov
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: growl-rspec
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
description: ! " This is a console reporter for spinach. It works with
|
143
|
+
Jenkins console ANSI\n color output plugin (https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin)\n
|
144
|
+
\ to output colorfully in Jenkins.\n"
|
145
|
+
email:
|
146
|
+
- ywen.github@gmail.com
|
147
|
+
executables: []
|
148
|
+
extensions: []
|
149
|
+
extra_rdoc_files: []
|
150
|
+
files:
|
151
|
+
- .gitignore
|
152
|
+
- .rspec
|
153
|
+
- .rvmrc.template
|
154
|
+
- Gemfile
|
155
|
+
- Guardfile
|
156
|
+
- LICENSE
|
157
|
+
- README.md
|
158
|
+
- Rakefile
|
159
|
+
- lib/spinach-console-reporter.rb
|
160
|
+
- lib/spinach-console-reporter/error_reporting.rb
|
161
|
+
- lib/spinach-console-reporter/gem_description.rb
|
162
|
+
- lib/spinach-console-reporter/out.rb
|
163
|
+
- spec/spec_helper.rb
|
164
|
+
- spinach-console-reporter.gemspec
|
165
|
+
- tasks/ci.rake
|
166
|
+
homepage: https://github.com/ywen/spinach-console-reporter
|
167
|
+
licenses: []
|
168
|
+
post_install_message:
|
169
|
+
rdoc_options: []
|
170
|
+
require_paths:
|
171
|
+
- lib
|
172
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
none: false
|
174
|
+
requirements:
|
175
|
+
- - ! '>='
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '0'
|
178
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
|
+
none: false
|
180
|
+
requirements:
|
181
|
+
- - ! '>='
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
requirements: []
|
185
|
+
rubyforge_project:
|
186
|
+
rubygems_version: 1.8.23
|
187
|
+
signing_key:
|
188
|
+
specification_version: 3
|
189
|
+
summary: A console reporter for spinach
|
190
|
+
test_files:
|
191
|
+
- spec/spec_helper.rb
|
192
|
+
has_rdoc:
|