module Specjour::Rspec::Runner
  def self.run(spec, output)
    reset
    options = ['--format=Specjour::Rspec::DistributedFormatter', spec]
    ::Rspec::Core::Runner.run options, $stderr, output
  end

  def self.reset
    ::Rspec.instance_variable_set(:@world, nil)
    ::Rspec.configuration.instance_variable_set(:@formatter, nil)
  end
end

module Specjour::Rspec::Runner
  def self.run(spec, output)
    reset
    options = ['--format=Specjour::Rspec::DistributedFormatter', spec]
    ::Rspec::Core::Runner.run options, $stderr, output
  end

  def self.reset
    ::Rspec.world.instance_variable_set(:@example_groups, [])
    ::Rspec.configuration.instance_variable_set(:@formatter, nil)
  end
end

Fix shared_examples not persisting between runs
Fix shared_examples not persisting between runs

Resetting the world removes shared_examples which we don't
want to do. Resetting example groups seems to work just fine.
