Skip to content

Instantly share code, notes, and snippets.

@JohnPlummer
Created February 23, 2011 11:59
Show Gist options
  • Save JohnPlummer/840336 to your computer and use it in GitHub Desktop.
Save JohnPlummer/840336 to your computer and use it in GitHub Desktop.
Stop in rails console if something fails in cucumber test. From http://railsdog.com/blog/2011/02/22/cucumber-testing-tips/ (Neeraj Singh)
# Usage:
# @wip @stop
# At the end of features/support/env.rb add the following line
# require File.expand_path(File.dirname(__FILE__) + '/stop')
# $ cucumber -p wip
After do |scenario|
if scenario.failed? && scenario.source_tag_names.include?("@wip") && scenario.source_tag_names.include?("@stop")
puts "Scenario failed. You are in rails console becuase of @stop. Type exit when you are done"
require 'irb'
require 'irb/completion'
ARGV.clear
IRB.start
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment