2018-01-03 13:51:04 +00:00
|
|
|
|
|
|
|
|
2017-12-14 10:49:35 +00:00
|
|
|
require 'rake_helper'
|
|
|
|
|
|
|
|
describe 'gitlab:git rake tasks' do
|
|
|
|
before do
|
|
|
|
Rake.application.rake_require 'tasks/gitlab/git'
|
|
|
|
|
2017-12-14 13:53:34 +00:00
|
|
|
storages = { 'default' => { 'path' => Settings.absolute('tmp/tests/default_storage') } }
|
2017-12-14 10:49:35 +00:00
|
|
|
|
2018-01-03 13:51:04 +00:00
|
|
|
FileUtils.mkdir_p(Settings.absolute('tmp/tests/default_storage/@repo/1/2/test.git'))
|
2017-12-14 13:53:34 +00:00
|
|
|
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages)
|
|
|
|
stub_warn_user_is_not_gitlab
|
2017-12-14 10:49:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
after do
|
|
|
|
FileUtils.rm_rf(Settings.absolute('tmp/tests/default_storage'))
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'fsck' do
|
|
|
|
it 'outputs the right git command' do
|
2017-12-14 13:53:34 +00:00
|
|
|
expect { run_rake_task('gitlab:git:fsck') }.to output(/Performed Checking integrity/).to_stdout
|
2017-12-14 10:49:35 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|