Permalink
Browse files

Merge pull request #95 from nikitachernov/patch-1

Cucumber fails on nil and does not print out failed tests
  • Loading branch information...
2 parents 7f6030b + b835063 commit 7b6bc85124ab7503dbd5128f2544330455ae2734 @aslakhellesoy aslakhellesoy committed Jul 10, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/cucumber/formatter/html.rb
@@ -373,8 +373,8 @@ def build_exception_detail(exception)
@builder.div(:class => 'message') do
message = exception.message
if defined?(RAILS_ROOT) && message.include?('Exception caught')
- matches = message.match(/Showing <i>(.+)<\/i>(?:.+)#(\d+)/)
- backtrace += ["#{RAILS_ROOT}/#{matches[1]}:#{matches[2]}"]
+ matches = message.match(/Showing <i>(.+)<\/i>(?:.+) #(\d+)/)
+ backtrace += ["#{RAILS_ROOT}/#{matches[1]}:#{matches[2]}"] if matches
message = message.match(/<code>([^(\/)]+)<\//m)[1]
end
@builder.pre do

0 comments on commit 7b6bc85

Please sign in to comment.