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

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

Instance Method Summary collapse

Instance Method Details

#setupObject



26
27
28
29
30
31
# File 'lib/cli/kit/support/test_helper.rb', line 26

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

#teardownObject



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

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