diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-28 21:06:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-28 21:06:24 +0000 |
commit | ef326e805ac99222c55e1efd9867045800f01a4b (patch) | |
tree | 201d39fb90a1422cc1f523d95b30b93e95f973f5 /spec/tasks | |
parent | 7515ec41c527c62bfd56f46e388cf6d9fe06479f (diff) | |
download | gitlab-ce-ef326e805ac99222c55e1efd9867045800f01a4b.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/task_helpers_spec.rb | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/spec/tasks/gitlab/task_helpers_spec.rb b/spec/tasks/gitlab/task_helpers_spec.rb index 4b4f7d7c956..4546d3bdfaf 100644 --- a/spec/tasks/gitlab/task_helpers_spec.rb +++ b/spec/tasks/gitlab/task_helpers_spec.rb @@ -20,22 +20,12 @@ describe Gitlab::TaskHelpers do end it 'checkout the version and reset to it' do + expect(subject).to receive(:get_version).with(version).and_call_original expect(subject).to receive(:checkout_version).with(tag, clone_path) subject.checkout_or_clone_version(version: version, repo: repo, target_dir: clone_path) end - context 'with a branch version' do - let(:version) { '=branch_name' } - let(:branch) { 'branch_name' } - - it 'checkout the version and reset to it with a branch name' do - expect(subject).to receive(:checkout_version).with(branch, clone_path) - - subject.checkout_or_clone_version(version: version, repo: repo, target_dir: clone_path) - end - end - context "target_dir doesn't exist" do it 'clones the repo' do expect(subject).to receive(:clone_repo).with(repo, clone_path) @@ -96,4 +86,19 @@ describe Gitlab::TaskHelpers do expect { subject.run_command!(['bash', '-c', 'exit 1']) }.to raise_error Gitlab::TaskFailedError end end + + describe '#get_version' do + using RSpec::Parameterized::TableSyntax + + where(:version, :result) do + '1.1.1' | 'v1.1.1' + 'master' | 'master' + '12.4.0-rc7' | 'v12.4.0-rc7' + '594c3ea3e0e5540e5915bd1c49713a0381459dd6' | '594c3ea3e0e5540e5915bd1c49713a0381459dd6' + end + + with_them do + it { expect(subject.get_version(version)).to eq(result) } + end + end end |