diff --git a/lib/pry-rescue/rspec.rb b/lib/pry-rescue/rspec.rb index 0d9a1aa..33372b2 100644 --- a/lib/pry-rescue/rspec.rb +++ b/lib/pry-rescue/rspec.rb @@ -50,7 +50,13 @@ def self.monkeypatch_capybara unless Capybara.respond_to?(:reset_sessions_after_rescue!) class << Capybara alias_method :reset_sessions_after_rescue!, :reset_sessions! - def reset_sessions!; end + def reset_sessions! + return if Capybara.raise_server_errors + + session_pool.reverse_each do |_mode, session| + session.server.reset_error! + end + end end after_filters << Capybara.method(:reset_sessions_after_rescue!)