From e3ff928c753447bfad33ff3facd51bfde3e32878 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 23 Apr 2018 11:40:55 +0200 Subject: Describe workaround when restore fails because of `Errno::EBUSY` When `Errno::EBUSY` is raised during restore, this could indicate that the directory being restored into is a mountpoint. In this case we explain the user how to retry the restore. --- spec/lib/backup/repository_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec/lib/backup/repository_spec.rb') diff --git a/spec/lib/backup/repository_spec.rb b/spec/lib/backup/repository_spec.rb index e4c1c9bafc0..b3777be312b 100644 --- a/spec/lib/backup/repository_spec.rb +++ b/spec/lib/backup/repository_spec.rb @@ -81,6 +81,18 @@ describe Backup::Repository do 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 -- cgit v1.2.1