class RSpecJUnitFormatter
def swap_rspec_configuration(key, value)
configuration. This method makes sure configuration gets swapped in
the way it cascades defaults, command line arguments, and user
rspec makes it really difficult to swap in configuration temporarily due to
def swap_rspec_configuration(key, value) unset = Object.new force = RSpec.configuration.send(:value_for, key) { unset } if unset.equal?(force) previous = RSpec.configuration.send(key) RSpec.configuration.send(:"#{key}=", value) else RSpec.configuration.force({key => value}) end yield ensure if unset.equal?(force) RSpec.configuration.send(:"#{key}=", previous) else RSpec.configuration.force({key => force}) end end