Skip to content
This repository

Cucumber fails on nil and does not print out failed tests #95

Merged
merged 1 commit into from almost 3 years ago

2 participants

Nikita Aslak Hellesøy
Nikita

Cucumber fails on nil and does not print out failed tests so its impossible to react on unsuccessful build.

Nikita

I don't know how this failing message looks, but checking "message.include?('Exception caught')" doesn't imply that it will match /Showing (.+)<\/i>(?:.+)#(\d+)/.
Since it's not - variable 'matches' is nil and process gets aborted while evaluating nil[1].

Aslak Hellesøy aslakhellesoy merged commit b835063 into from July 17, 2011
Aslak Hellesøy aslakhellesoy closed this July 17, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 28, 2011
Nikita Cucumber fails on nil and does not print out failed tests (impossible…
… to react on unsuccessful build).
b835063
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  lib/cucumber/formatter/html.rb
4  lib/cucumber/formatter/html.rb
@@ -373,8 +373,8 @@ def build_exception_detail(exception)
373 373
         @builder.div(:class => 'message') do
374 374
           message = exception.message
375 375
           if defined?(RAILS_ROOT) && message.include?('Exception caught')
376  
-            matches = message.match(/Showing <i>(.+)<\/i>(?:.+)#(\d+)/)
377  
-            backtrace += ["#{RAILS_ROOT}/#{matches[1]}:#{matches[2]}"]
  376
+            matches = message.match(/Showing <i>(.+)<\/i>(?:.+) #(\d+)/)
  377
+            backtrace += ["#{RAILS_ROOT}/#{matches[1]}:#{matches[2]}"] if matches
378 378
             message = message.match(/<code>([^(\/)]+)<\//m)[1]
379 379
           end
380 380
           @builder.pre do 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.