Even more specs

parent 1f1226ff
...@@ -214,6 +214,30 @@ describe Backup::Manager do ...@@ -214,6 +214,30 @@ describe Backup::Manager do
end end
end end
describe 'verify_restore' do
context 'on Version mismatch' do
let(:gitlab_version) { Gitlab::VERSION }
it 'stops the process' do
allow(YAML).to receive(:load_file)
.and_return({ gitlab_version: "not #{gitlab_version}" })
expect { subject.verify_restore }.to raise_error SystemExit
end
end
context 'on Version match' do
let(:gitlab_version) { Gitlab::VERSION }
it 'does nothing' do
allow(YAML).to receive(:load_file)
.and_return({ gitlab_version: "#{gitlab_version}" })
expect { subject.verify_restore }.not_to raise_error
end
end
end
describe '#unpack' do describe '#unpack' do
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
......
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