If some Rspec fails (or anything else for that matter), exec_in_context doesn't reset the application context properly, and large numbers of tests afterwards start to fail.
Fix is basically to wrap the code in ensure blocks.
In Lebowski::Foundation::Support::ApplicationContextManager
def exec_in_context(app, app_name=nil, &block)
previous_app_context = @current_application_context.clone
switch_application_context_to app, app_name
yield app
ensure
switch_application_context_to previous_app_context[:app], previous_app_context[:app_name]
end
def exec_driver_in_context(app, &block)
previous_app_context = nil
if not has_current_application_context?(app)
previous_app_context = @current_application_context.clone
switch_application_context_to app
end
yield @driver
ensure
if not previous_app_context.nil?
switch_application_context_to previous_app_context[:app], previous_app_context[:app_name]
end
If some Rspec fails (or anything else for that matter), exec_in_context doesn't reset the application context properly, and large numbers of tests afterwards start to fail.
Fix is basically to wrap the code in ensure blocks.
In Lebowski::Foundation::Support::ApplicationContextManager
There are more elegant ways of doing it probably.