Skip to content

Instantly share code, notes, and snippets.

@matflores
Created September 13, 2010 17:51
Show Gist options
  • Save matflores/577724 to your computer and use it in GitHub Desktop.
Save matflores/577724 to your computer and use it in GitHub Desktop.
# inside class Protest::TestCase
class << self
alias original_scenario scenario
def scenario(name, options = {}, &block)
original_scenario(name) do
old_driver, Capybara.current_driver = Capybara.current_driver, options[:driver] || Capybara.current_driver
instance_eval(&block)
Capybara.current_driver = old_driver
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment