Sha256: 2d1a75f76dc30a604681276c78f57b6f9244793cea3afc697bb941af4e24ee33

Contents?: true

Size: 520 Bytes

Versions: 44

Compression:

Stored size: 520 Bytes

Contents

# Patch rspec to allow nested execution
module Rspec
  # Run block in clean rspec environment
  #
  # @return [Object]
  #   returns the value of block
  #
  # @api private
  #
  def self.nest
    original_world, original_configuration =
      ::RSpec.instance_variable_get(:@world),
      ::RSpec.instance_variable_get(:@configuration)

    ::RSpec.reset

    yield
  ensure
    ::RSpec.instance_variable_set(:@world, original_world)
    ::RSpec.instance_variable_set(:@configuration, original_configuration)
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
mutant-0.3.0.beta5 spec/support/rspec.rb
mutant-0.3.0.beta4 spec/support/rspec.rb
mutant-0.3.0.beta3 spec/support/rspec.rb
mutant-0.3.0.beta2 spec/support/rspec.rb