RSpec fails to return a proper error code when a capybara test fails
Created by: dblock
This is a workaround for https://github.com/jnicklas/capybara/issues/178. Capybara has an at_exit call that messes up the status code returned from the process. This workaround ensures that at_exit from rspec is run last (ie. is setup first).
The same was applied in minitest https://github.com/seattlerb/minitest/commit/979406d726fa1866aba6dc4e3ed7692a4758c0ec.