2016-08-03 00:46:43 -04:00
|
|
|
require 'rake_helper'
|
|
|
|
|
|
|
|
describe 'gitlab:shell rake tasks' do
|
|
|
|
before do
|
|
|
|
Rake.application.rake_require 'tasks/gitlab/shell'
|
|
|
|
|
|
|
|
stub_warn_user_is_not_gitlab
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'install task' do
|
|
|
|
it 'invokes create_hooks task' do
|
|
|
|
expect(Rake::Task['gitlab:shell:create_hooks']).to receive(:invoke)
|
|
|
|
|
2017-05-02 11:44:40 -04:00
|
|
|
storages = Gitlab.config.repositories.storages.values.map { |rs| rs['path'] }
|
|
|
|
expect(Kernel).to receive(:system).with('bin/install', *storages).and_call_original
|
|
|
|
expect(Kernel).to receive(:system).with('bin/compile').and_call_original
|
|
|
|
|
2016-08-03 00:46:43 -04:00
|
|
|
run_rake_task('gitlab:shell:install')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'create_hooks task' do
|
|
|
|
it 'calls gitlab-shell bin/create_hooks' do
|
|
|
|
expect_any_instance_of(Object).to receive(:system)
|
2017-08-08 11:14:29 -04:00
|
|
|
.with("#{Gitlab.config.gitlab_shell.path}/bin/create-hooks",
|
|
|
|
*Gitlab::TaskHelpers.repository_storage_paths_args)
|
2016-08-03 00:46:43 -04:00
|
|
|
|
|
|
|
run_rake_task('gitlab:shell:create_hooks')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|