From 5b9e7773766eebbe73bb400025de002962532a7c Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 3 Jan 2018 15:32:16 +0100 Subject: [PATCH] add lock specs --- spec/tasks/gitlab/git_rake_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/tasks/gitlab/git_rake_spec.rb b/spec/tasks/gitlab/git_rake_spec.rb index 19d298fb36d..44a2607bea2 100644 --- a/spec/tasks/gitlab/git_rake_spec.rb +++ b/spec/tasks/gitlab/git_rake_spec.rb @@ -21,5 +21,18 @@ describe 'gitlab:git rake tasks' do it 'outputs the right git command' do expect { run_rake_task('gitlab:git:fsck') }.to output(/Performed Checking integrity/).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')) + + 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')) + + expect { run_rake_task('gitlab:git:fsck') }.to output(/Ref lock files exist:/).to_stdout + end end end