Module: CLI::Kit::Support::TestHelper::FakeConfig

Defined in:
lib/cli/kit/support/test_helper.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



32
33
34
35
36
37
# File 'lib/cli/kit/support/test_helper.rb', line 32

def setup
  super
  @tmpdir = Dir.mktmpdir
  @prev_xdg = ENV['XDG_CONFIG_HOME']
  ENV['XDG_CONFIG_HOME'] = @tmpdir
end

#teardownObject



39
40
41
42
43
# File 'lib/cli/kit/support/test_helper.rb', line 39

def teardown
  FileUtils.rm_rf(@tmpdir)
  ENV['XDG_CONFIG_HOME'] = @prev_xdg
  super
end