176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
# File 'lib/motion-spec/specification.rb', line 176
def execute_block
yield
rescue Object => e
@exception_occurred = true
if e.is_a?(Exception)
ErrorLog << "#{e.class}: #{e.message}\n"
lines = $DEBUG ? e.backtrace : e.backtrace.find_all { |line| line !~ /bin\/macbacon|\/mac_bacon\.rb:\d+/ }
lines.each_with_index { |line, i|
ErrorLog << "\t#{line}#{i == 0 ? ": #{@context.name} - #{@description}" : ''}\n"
}
ErrorLog << "\n"
else
if defined?(NSException)
ErrorLog << "#{e.name}: #{e.reason}\n"
else
ErrorLog << "#{e.class.toString} : #{e.getMessage}"
end
end
@error =
if e.is_a? Error
Counter[e.count_as] += 1
"#{e.count_as.to_s.upcase} - #{e}"
else
Counter[:errors] += 1
"ERROR: #{e.class} - #{e}"
end
end
|