Created
February 23, 2011 11:59
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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