Class: XSpec::Notifier::FailuresAtEnd
Overview
Outputs error messages and backtraces after the entire run is complete.
Instance Method Summary
collapse
#run_start, #short_id_for
Methods included from Composable
#+
#evaluate_start, #run_start
Constructor Details
#initialize(out = $stdout) ⇒ FailuresAtEnd
172
173
174
175
|
# File 'lib/xspec/notifiers.rb', line 172
def initialize(out = $stdout)
@errors = []
@out = out
end
|
Instance Method Details
#evaluate_finish(result) ⇒ Object
177
178
179
|
# File 'lib/xspec/notifiers.rb', line 177
def evaluate_finish(result)
self.errors += result.errors
end
|
#run_finish ⇒ Object
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
# File 'lib/xspec/notifiers.rb', line 181
def run_finish
return true if errors.empty?
out.puts
errors.each do |error|
out.puts "%s - %s\n%s\n\n" % [
short_id_for(error.unit_of_work),
error.unit_of_work.full_name,
error.message.lines.map {|x| " #{x}"}.join("")
]
clean_backtrace(error.caller).each do |line|
out.puts " %s" % line
end
out.puts
end
false
end
|