spec/signore/settings_spec.rb in signore-0.3.1 vs spec/signore/settings_spec.rb in signore-0.3.2

- old
+ new

@@ -10,28 +10,28 @@ it 'is defined by the first argument' do Settings.new(['prego']).action.must_equal 'prego' end end - describe '#db_path' do + describe '#repo_path' do it 'honours XDG_DATA_HOME if it’s set' do begin old_xdg = ENV.delete('XDG_DATA_HOME') tempdir = Dir.mktmpdir ENV['XDG_DATA_HOME'] = tempdir path = "#{tempdir}/signore/signatures.yml" - Settings.new.db_path.must_equal Pathname.new(path) + Settings.new.repo_path.must_equal Pathname.new(path) ensure FileUtils.rmtree tempdir old_xdg ? ENV['XDG_DATA_HOME'] = old_xdg : ENV.delete('XDG_DATA_HOME') end end it 'defaults XDG_DATA_HOME to ~/.local/share if it’s not set' do begin old_xdg = ENV.delete('XDG_DATA_HOME') path = File.expand_path('~/.local/share/signore/signatures.yml') - Settings.new.db_path.must_equal Pathname.new(path) + Settings.new.repo_path.must_equal Pathname.new(path) ensure ENV['XDG_DATA_HOME'] = old_xdg if old_xdg end end end