Commit 8b8bab11 authored by Rémy Coutable's avatar Rémy Coutable

Stub ENV in the backup task spec file

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 9c71fb0d
...@@ -101,8 +101,7 @@ module Backup ...@@ -101,8 +101,7 @@ module Backup
end end
def unpack def unpack
Dir.chdir(backup_path) Dir.chdir(backup_path) do
# check for existing backups in the backup dir # check for existing backups in the backup dir
if backup_file_list.empty? if backup_file_list.empty?
$progress.puts "No backups found in #{backup_path}" $progress.puts "No backups found in #{backup_path}"
...@@ -147,6 +146,7 @@ module Backup ...@@ -147,6 +146,7 @@ module Backup
exit 1 exit 1
end end
end end
end
def tar_version def tar_version
tar_version, _ = Gitlab::Popen.popen(%w(tar --version)) tar_version, _ = Gitlab::Popen.popen(%w(tar --version))
......
...@@ -172,10 +172,6 @@ describe Backup::Manager do ...@@ -172,10 +172,6 @@ describe Backup::Manager do
end end
describe '#unpack' do describe '#unpack' do
before do
allow(Dir).to receive(:chdir)
end
context 'when there are no backup files in the directory' do context 'when there are no backup files in the directory' do
before do before do
allow(Dir).to receive(:glob).and_return([]) allow(Dir).to receive(:glob).and_return([])
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment