Clear out formatters when resetting configuration
Created by: johnbintz
I'm using RSpec with Hydra, which calls RSpec::Core::Runner.run
once for each file that is sent to each Hydra runner. Calling RSpec.reset
resets most of the environment for the Hydra use case, but doesn't clear out the @formatters
between each run. This means that running 10 files in a Hydra runner causes 10 copies of the RSpec output to be sent to the user on the last run, which is very confusing indeed.
Resetting @formatters
in RSpec::Core::Configuration#reset
fixes this issue:
def reset
@reporter = nil
@formatters = []
end
I can't see a case where one would want to destroy the reporter but keep the old formatters around, but please correct me otherwise.