public
Created

Monkey-patch Capybara to not reset sessions after each example

  • Download Gist
monkeypath_capybara.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 
# Don't let capybara reset sessions
# See : https://github.com/jnicklas/capybara/blob/master/lib/capybara/rspec.rb#L16
module Capybara
class << self
alias_method :old_reset_sessions!, :reset_sessions!
def reset_sessions!; end
end
end
 
# Reset sessions again.
module Capybara
class << self
alias_method :reset_sessions!, :old_reset_sessions!
remove_method :old_reset_sessions!
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.