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

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

Instance Method Summary collapse

Instance Method Details

#setupObject



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

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

#teardownObject



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

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