diff options
Diffstat (limited to 'spec/tasks/gitlab')
-rw-r--r-- | spec/tasks/gitlab/backup_rake_spec.rb | 20 | ||||
-rw-r--r-- | spec/tasks/gitlab/check_rake_spec.rb | 4 | ||||
-rw-r--r-- | spec/tasks/gitlab/shell_rake_spec.rb | 4 | ||||
-rw-r--r-- | spec/tasks/gitlab/task_helpers_spec.rb | 32 | ||||
-rw-r--r-- | spec/tasks/gitlab/workhorse_rake_spec.rb | 8 |
5 files changed, 34 insertions, 34 deletions
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb index df8a47893f9..85c34a00b11 100644 --- a/spec/tasks/gitlab/backup_rake_spec.rb +++ b/spec/tasks/gitlab/backup_rake_spec.rb @@ -47,24 +47,24 @@ describe 'gitlab:app namespace rake task' do allow(Kernel).to receive(:system).and_return(true) allow(FileUtils).to receive(:cp_r).and_return(true) allow(FileUtils).to receive(:mv).and_return(true) - allow(Rake::Task["gitlab:shell:setup"]). - to receive(:invoke).and_return(true) + allow(Rake::Task["gitlab:shell:setup"]) + .to receive(:invoke).and_return(true) ENV['force'] = 'yes' end let(:gitlab_version) { Gitlab::VERSION } it 'fails on mismatch' do - allow(YAML).to receive(:load_file). - and_return({ gitlab_version: "not #{gitlab_version}" }) + allow(YAML).to receive(:load_file) + .and_return({ gitlab_version: "not #{gitlab_version}" }) - expect { run_rake_task('gitlab:backup:restore') }. - to raise_error(SystemExit) + expect { run_rake_task('gitlab:backup:restore') } + .to raise_error(SystemExit) end it 'invokes restoration on match' do - allow(YAML).to receive(:load_file). - and_return({ gitlab_version: gitlab_version }) + allow(YAML).to receive(:load_file) + .and_return({ gitlab_version: gitlab_version }) expect(Rake::Task['gitlab:db:drop_tables']).to receive(:invoke) expect(Rake::Task['gitlab:backup:db:restore']).to receive(:invoke) expect(Rake::Task['gitlab:backup:repo:restore']).to receive(:invoke) @@ -320,8 +320,8 @@ describe 'gitlab:app namespace rake task' do end it 'does not invoke repositories restore' do - allow(Rake::Task['gitlab:shell:setup']). - to receive(:invoke).and_return(true) + allow(Rake::Task['gitlab:shell:setup']) + .to receive(:invoke).and_return(true) allow($stdout).to receive :write expect(Rake::Task['gitlab:db:drop_tables']).to receive :invoke diff --git a/spec/tasks/gitlab/check_rake_spec.rb b/spec/tasks/gitlab/check_rake_spec.rb index a808ef7dcc0..538ff952bf4 100644 --- a/spec/tasks/gitlab/check_rake_spec.rb +++ b/spec/tasks/gitlab/check_rake_spec.rb @@ -23,8 +23,8 @@ describe 'gitlab:ldap:check rake task' do let(:adapter) { ldap_adapter('ldapmain', ldap) } before do - allow(Gitlab::LDAP::Config). - to receive_messages( + allow(Gitlab::LDAP::Config) + .to receive_messages( enabled?: true, providers: ['ldapmain'] ) diff --git a/spec/tasks/gitlab/shell_rake_spec.rb b/spec/tasks/gitlab/shell_rake_spec.rb index 0787894ad2c..226d34fe2c9 100644 --- a/spec/tasks/gitlab/shell_rake_spec.rb +++ b/spec/tasks/gitlab/shell_rake_spec.rb @@ -17,8 +17,8 @@ describe 'gitlab:shell rake tasks' do describe 'create_hooks task' do it 'calls gitlab-shell bin/create_hooks' do - expect_any_instance_of(Object).to receive(:system). - with("#{Gitlab.config.gitlab_shell.path}/bin/create-hooks", *repository_storage_paths_args) + expect_any_instance_of(Object).to receive(:system) + .with("#{Gitlab.config.gitlab_shell.path}/bin/create-hooks", *repository_storage_paths_args) run_rake_task('gitlab:shell:create_hooks') end diff --git a/spec/tasks/gitlab/task_helpers_spec.rb b/spec/tasks/gitlab/task_helpers_spec.rb index 86e42d845ce..528fdbaaa74 100644 --- a/spec/tasks/gitlab/task_helpers_spec.rb +++ b/spec/tasks/gitlab/task_helpers_spec.rb @@ -41,8 +41,8 @@ describe Gitlab::TaskHelpers do describe '#clone_repo' do it 'clones the repo in the target dir' do - expect(subject). - to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} clone -- #{repo} #{clone_path}]) + expect(subject) + .to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} clone -- #{repo} #{clone_path}]) subject.clone_repo(repo, clone_path) end @@ -50,10 +50,10 @@ describe Gitlab::TaskHelpers do describe '#checkout_tag' do it 'clones the repo in the target dir' do - expect(subject). - to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} fetch --tags --quiet]) - expect(subject). - to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} checkout --quiet #{tag}]) + expect(subject) + .to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} fetch --tags --quiet]) + expect(subject) + .to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} checkout --quiet #{tag}]) subject.checkout_tag(tag, clone_path) end @@ -62,21 +62,21 @@ describe Gitlab::TaskHelpers do describe '#reset_to_tag' do let(:tag) { 'v1.1.0' } before do - expect(subject). - to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} reset --hard #{tag}]) + expect(subject) + .to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} reset --hard #{tag}]) end context 'when the tag is not checked out locally' do before do - expect(subject). - to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} describe -- #{tag}]).and_raise(Gitlab::TaskFailedError) + expect(subject) + .to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} describe -- #{tag}]).and_raise(Gitlab::TaskFailedError) end it 'fetch origin, ensure the tag exists, and resets --hard to the given tag' do - expect(subject). - to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} fetch origin]) - expect(subject). - to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} describe -- origin/#{tag}]).and_return(tag) + expect(subject) + .to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} fetch origin]) + expect(subject) + .to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} describe -- origin/#{tag}]).and_return(tag) subject.reset_to_tag(tag, clone_path) end @@ -84,8 +84,8 @@ describe Gitlab::TaskHelpers do context 'when the tag is checked out locally' do before do - expect(subject). - to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} describe -- #{tag}]).and_return(tag) + expect(subject) + .to receive(:run_command!).with(%W[#{Gitlab.config.git.bin_path} -C #{clone_path} describe -- #{tag}]).and_return(tag) end it 'resets --hard to the given tag' do diff --git a/spec/tasks/gitlab/workhorse_rake_spec.rb b/spec/tasks/gitlab/workhorse_rake_spec.rb index 6de66c3cf07..da4b408023c 100644 --- a/spec/tasks/gitlab/workhorse_rake_spec.rb +++ b/spec/tasks/gitlab/workhorse_rake_spec.rb @@ -23,8 +23,8 @@ describe 'gitlab:workhorse namespace rake task' do context 'when an underlying Git command fail' do it 'aborts and display a help message' do - expect_any_instance_of(Object). - to receive(:checkout_or_clone_tag).and_raise 'Git error' + expect_any_instance_of(Object) + .to receive(:checkout_or_clone_tag).and_raise 'Git error' expect { run_rake_task('gitlab:workhorse:install', clone_path) }.to raise_error 'Git error' end @@ -36,8 +36,8 @@ describe 'gitlab:workhorse namespace rake task' do end it 'calls checkout_or_clone_tag with the right arguments' do - expect_any_instance_of(Object). - to receive(:checkout_or_clone_tag).with(tag: tag, repo: repo, target_dir: clone_path) + expect_any_instance_of(Object) + .to receive(:checkout_or_clone_tag).with(tag: tag, repo: repo, target_dir: clone_path) run_rake_task('gitlab:workhorse:install', clone_path) end |