summaryrefslogtreecommitdiff
path: root/spec/tasks
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2018-01-04 11:02:43 +0100
committerJames Lopez <james@jameslopez.es>2018-01-04 11:22:43 +0100
commitde36a8e27961d4c2af43d0ac2d700a391c245353 (patch)
treebcd16bc00216fe9f236c091e39b6d0352392070e /spec/tasks
parent6ee122c04ee8263dc1cb9dfddd010c5c0b587e8e (diff)
downloadgitlab-ce-de36a8e27961d4c2af43d0ac2d700a391c245353.tar.gz
refactor spec, add docs
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/git_rake_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/tasks/gitlab/git_rake_spec.rb b/spec/tasks/gitlab/git_rake_spec.rb
index 44a2607bea2..dacc5dc5ae7 100644
--- a/spec/tasks/gitlab/git_rake_spec.rb
+++ b/spec/tasks/gitlab/git_rake_spec.rb
@@ -1,5 +1,3 @@
-
-
require 'rake_helper'
describe 'gitlab:git rake tasks' do
@@ -8,8 +6,10 @@ describe 'gitlab:git rake tasks' do
storages = { 'default' => { 'path' => Settings.absolute('tmp/tests/default_storage') } }
- FileUtils.mkdir_p(Settings.absolute('tmp/tests/default_storage/@repo/1/2/test.git'))
+ FileUtils.mkdir_p(Settings.absolute('tmp/tests/default_storage/@hashed/1/2/test.git'))
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages)
+ allow_any_instance_of(String).to receive(:color) { |string, _color| string }
+
stub_warn_user_is_not_gitlab
end
@@ -18,19 +18,19 @@ describe 'gitlab:git rake tasks' do
end
describe 'fsck' do
- it 'outputs the right git command' do
- expect { run_rake_task('gitlab:git:fsck') }.to output(/Performed Checking integrity/).to_stdout
+ it 'outputs the integrity check for a repo' do
+ expect { run_rake_task('gitlab:git:fsck') }.to output(/Performed Checking integrity at .*@hashed\/1\/2\/test.git/).to_stdout
end
it 'errors out about config.lock issues' do
- FileUtils.touch(Settings.absolute('tmp/tests/default_storage/@repo/1/2/test.git/config.lock'))
+ FileUtils.touch(Settings.absolute('tmp/tests/default_storage/@hashed/1/2/test.git/config.lock'))
expect { run_rake_task('gitlab:git:fsck') }.to output(/file exists\? ... yes/).to_stdout
end
it 'errors out about ref lock issues' do
- FileUtils.mkdir_p(Settings.absolute('tmp/tests/default_storage/@repo/1/2/test.git/refs/heads'))
- FileUtils.touch(Settings.absolute('tmp/tests/default_storage/@repo/1/2/test.git/refs/heads/blah.lock'))
+ FileUtils.mkdir_p(Settings.absolute('tmp/tests/default_storage/@hashed/1/2/test.git/refs/heads'))
+ FileUtils.touch(Settings.absolute('tmp/tests/default_storage/@hashed/1/2/test.git/refs/heads/blah.lock'))
expect { run_rake_task('gitlab:git:fsck') }.to output(/Ref lock files exist:/).to_stdout
end