Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Created November 9, 2010 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dchelimsky/669112 to your computer and use it in GitHub Desktop.
Save dchelimsky/669112 to your computer and use it in GitHub Desktop.
swinger_without_rspec_monkey_patch.rb
RSpec.configure do |c|
c.around do |example|
Capybara.using_driver(example.metadata[:driver], &example)
end
end
module Capybara
def self.using_driver(driver)
Capybara.current_driver = driver
yield
ensure
Capybara.use_default_driver
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment