|
30 | 30 | # On stable branches and tags, generate-facts will not populate version facts
|
31 | 31 | # So, the content of the VERSION file will be used as-is.
|
32 | 32 | it 'returns tag with v prefix' do
|
33 |
| - allow(File).to receive(:exist?).with(/gitlab-rails_version/).and_return(false) |
| 33 | + allow(File).to receive(:exist?).with(/gitlab-rails.*version/).and_return(false) |
34 | 34 | allow(File).to receive(:read).with(/VERSION/).and_return('15.7.0')
|
35 | 35 | expect(described_class.ref).to eq('v15.7.0')
|
36 | 36 | end
|
37 | 37 | end
|
38 | 38 |
|
39 | 39 | context 'when on feature branches' do
|
40 | 40 | it 'returns commit SHA without any prefix' do
|
41 |
| - allow(File).to receive(:exist?).with(/gitlab-rails_version/).and_return(true) |
42 |
| - allow(File).to receive(:read).with(/gitlab-rails_version/).and_return('arandomcommit') |
| 41 | + allow(File).to receive(:exist?).with(/gitlab-rails.*version/).and_return(true) |
| 42 | + allow(File).to receive(:read).with(/gitlab-rails.*version/).and_return('arandomcommit') |
43 | 43 | expect(described_class.ref).to eq('arandomcommit')
|
44 | 44 | end
|
45 | 45 | end
|
|
50 | 50 | # On stable branches and tags, generate-facts will not populate version facts
|
51 | 51 | # So, whatever is on VERSION file, will be used.
|
52 | 52 | it 'returns tag without v prefix' do
|
53 |
| - allow(File).to receive(:exist?).with(/gitlab-rails_version/).and_return(false) |
| 53 | + allow(File).to receive(:exist?).with(/gitlab-rails.*version/).and_return(false) |
54 | 54 | allow(File).to receive(:read).with(/VERSION/).and_return('15.7.0')
|
55 | 55 | expect(described_class.ref(prepend_version: false)).to eq('15.7.0')
|
56 | 56 | end
|
57 | 57 | end
|
58 | 58 |
|
59 | 59 | context 'when on feature branches' do
|
60 | 60 | it 'returns commit SHA without any prefix' do
|
61 |
| - allow(File).to receive(:exist?).with(/gitlab-rails_version/).and_return(true) |
62 |
| - allow(File).to receive(:read).with(/gitlab-rails_version/).and_return('arandomcommit') |
| 61 | + allow(File).to receive(:exist?).with(/gitlab-rails.*version/).and_return(true) |
| 62 | + allow(File).to receive(:read).with(/gitlab-rails.*version/).and_return('arandomcommit') |
63 | 63 | expect(described_class.ref(prepend_version: false)).to eq('arandomcommit')
|
64 | 64 | end
|
65 | 65 | end
|
|
0 commit comments