lib/rubygems/test_case.rb
def teardown
    $LOAD_PATH.replace @orig_LOAD_PATH if @orig_LOAD_PATH

    Gem::ConfigMap[:BASERUBY] = @orig_BASERUBY
    Gem::ConfigMap[:arch] = @orig_arch
    Gem::Security::OPT[:trust_dir] = @orig_trust_dir

    if defined? Gem::RemoteFetcher then
      Gem::RemoteFetcher.fetcher = nil
    end

    Dir.chdir @current_dir

    FileUtils.rm_rf @tempdir unless ENV['KEEP_FILES']

    ENV['GEM_HOME'] = @orig_gem_home
    ENV['GEM_PATH'] = @orig_gem_path

    _ = @orig_ruby
    Gem.class_eval { @ruby = _ } if _

    if @orig_ENV_HOME then
      ENV['HOME'] = @orig_ENV_HOME
    else
      ENV.delete 'HOME'
    end
  end
##
# #teardown restores the process to its original state and removes the
# tempdir unless the +KEEP_FILES+ environment variable was set.
teardown restores the process to its original state and removes the
tempdir unless the +KEEP_FILES+ environment variable was set.
teardown restores the process to its original state and removes the tempdir unless the + KEEP_FILES + environment variable was set .
def teardown
    $LOAD_PATH.replace @orig_LOAD_PATH if @orig_LOAD_PATH
    Gem::ConfigMap[:BASERUBY] = @orig_BASERUBY
    Gem::ConfigMap[:arch] = @orig_arch
    Gem::Security::OPT[:trust_dir] = @orig_trust_dir
    if defined? Gem::RemoteFetcher then
      Gem::RemoteFetcher.fetcher = nil
    end
    Dir.chdir @current_dir
    FileUtils.rm_rf @tempdir unless ENV['KEEP_FILES']
    ENV['GEM_HOME'] = @orig_gem_home
    ENV['GEM_PATH'] = @orig_gem_path
    _ = @orig_ruby
    Gem.class_eval { @ruby = _ } if _
    if @orig_ENV_HOME then
      ENV['HOME'] = @orig_ENV_HOME
    else
      ENV.delete 'HOME'
    end
  end
def teardown $LOAD_PATH . replace @orig_LOAD_PATH if @orig_LOAD_PATH Gem :: ConfigMap [ :BASERUBY ] = @orig_BASERUBY Gem :: ConfigMap [ :arch ] = @orig_arch Gem :: Security :: OPT [ :trust_dir ] = @orig_trust_dir if defined? Gem :: RemoteFetcher then Gem :: RemoteFetcher . fetcher = nil end Dir . chdir @current_dir FileUtils . rm_rf @tempdir unless ENV [ 'KEEP_FILES' ] ENV [ 'GEM_HOME' ] = @orig_gem_home ENV [ 'GEM_PATH' ] = @orig_gem_path _ = @orig_ruby Gem . class_eval { @ruby = _ } if _ if @orig_ENV_HOME then ENV [ 'HOME' ] = @orig_ENV_HOME else ENV . delete 'HOME' end end
teardown restores the process to its original state and removes the
tempdir unless the +KEEP_FILES+ environment variable was set.
teardown restores the process to its original state and removes the tempdir unless the + KEEP_FILES + environment variable was set .