diff options
author | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-05-16 17:17:05 +0300 |
---|---|---|
committer | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-05-16 17:17:05 +0300 |
commit | 7ea4a42395eb09f2c2bac2ed74297fca6188fd3b (patch) | |
tree | fcc32f54ef2a2cd278a5554fa16afc8003b7cb4f /spec/lib/backup | |
parent | 889c62c1e3a2c11e726d1160d92ff83cb3e0fd7d (diff) | |
download | gitlab-ce-7ea4a42395eb09f2c2bac2ed74297fca6188fd3b.tar.gz |
Fix failing specs
Diffstat (limited to 'spec/lib/backup')
-rw-r--r-- | spec/lib/backup/repository_spec.rb | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/spec/lib/backup/repository_spec.rb b/spec/lib/backup/repository_spec.rb index b1ea9c0b622..3a568506c11 100644 --- a/spec/lib/backup/repository_spec.rb +++ b/spec/lib/backup/repository_spec.rb @@ -49,14 +49,14 @@ describe Backup::Repository do describe 'command failure' do before do - allow(Gitlab::Popen).to receive(:popen).and_return(['error', 1]) + allow_any_instance_of(Gitlab::Shell).to receive(:create_repository).and_return(false) end context 'hashed storage' do it 'shows the appropriate error' do subject.restore - expect(progress).to have_received(:puts).with("Ignoring error on #{project.full_path} (#{project.disk_path}) - error") + expect(progress).to have_received(:puts).with("[Failed] restoring #{project.full_path} repository") end end @@ -66,33 +66,10 @@ describe Backup::Repository do it 'shows the appropriate error' do subject.restore - expect(progress).to have_received(:puts).with("Ignoring error on #{project.full_path} - error") + expect(progress).to have_received(:puts).with("[Failed] restoring #{project.full_path} repository") end end end - - describe 'folders without permissions' do - before do - allow(FileUtils).to receive(:mv).and_raise(Errno::EACCES) - end - - it 'shows error message' do - expect(subject).to receive(:access_denied_error) - subject.restore - end - end - - describe 'folder that is a mountpoint' do - before do - allow(FileUtils).to receive(:mv).and_raise(Errno::EBUSY) - end - - it 'shows error message' do - expect(subject).to receive(:resource_busy_error).and_call_original - - expect { subject.restore }.to raise_error(/is a mountpoint/) - end - end end describe '#empty_repo?' do |