a19f3b1691
* I do not use 1.9.3 * Also keeping them in each file increases mental overhead (true it *can* be autoamted) * None of the files encodes NON ASCII chars. * I do not expect it makes any difference, since nobody programmatically will consume strings generated by mutant under the assumption they are UTF-8 encoded. * 1.9.3 Users have to deal with the encoding fuckup under ruby anyways.
22 lines
520 B
Ruby
22 lines
520 B
Ruby
# 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
|