From b36751c89771d82f64635d4dccc624573d17c3c2 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 28 Feb 2014 11:57:58 +0100 Subject: Use VERSION contanst in backup specs --- spec/tasks/gitlab/backup_rake_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb index a5541bee876..c2f1d4e1b1c 100644 --- a/spec/tasks/gitlab/backup_rake_spec.rb +++ b/spec/tasks/gitlab/backup_rake_spec.rb @@ -32,7 +32,7 @@ describe 'gitlab:app namespace rake task' do Rake::Task["gitlab:shell:setup"].stub invoke: true end - let(:gitlab_version) { %x{git rev-parse HEAD}.gsub(/\n/,"") } + let(:gitlab_version) { Gitlab::VERSION } it 'should fail on mismatch' do YAML.stub load_file: {gitlab_version: gitlab_version.reverse} -- cgit v1.2.1 From 46b1c63b7af29ecc24292b20b7f246ff5f189048 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 28 Feb 2014 12:11:43 +0100 Subject: Make backup version blocker test more robust Assuming that VERSION != VERSION.reverse is not robust. This will fail at e.g. version 6.6.6. --- spec/tasks/gitlab/backup_rake_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb index c2f1d4e1b1c..71a45eb2fa6 100644 --- a/spec/tasks/gitlab/backup_rake_spec.rb +++ b/spec/tasks/gitlab/backup_rake_spec.rb @@ -35,7 +35,7 @@ describe 'gitlab:app namespace rake task' do let(:gitlab_version) { Gitlab::VERSION } it 'should fail on mismatch' do - YAML.stub load_file: {gitlab_version: gitlab_version.reverse} + YAML.stub load_file: {gitlab_version: "not #{gitlab_version}" } expect { run_rake_task }.to raise_error SystemExit end -- cgit v1.2.1