|
111 | 111 | end |
112 | 112 |
|
113 | 113 | describe 'point_to_same_commit?(ref1, ref2)' do |
114 | | - # We cannot test the happy path using a remote because the repo we use for the tests does not have a remote. |
115 | | - let(:remote_name) { nil } |
116 | | - |
117 | 114 | before do |
118 | 115 | # Spec branching setup: |
119 | 116 | # |
|
148 | 145 | end |
149 | 146 |
|
150 | 147 | it 'checks if a tag and a branch point to the same commit' do |
151 | | - same_commit = described_class.point_to_same_commit?('1.0', 'another-branch', remote_name: remote_name) |
| 148 | + same_commit = described_class.point_to_same_commit?('1.0', 'another-branch') |
152 | 149 | expect(same_commit).to be false |
153 | 150 | end |
154 | 151 |
|
155 | 152 | it 'checks if a tag and a branch that had a merge point to the same commit' do |
156 | | - same_commit = described_class.point_to_same_commit?('1.0', 'main', remote_name: remote_name) |
| 153 | + same_commit = described_class.point_to_same_commit?('1.0', 'main') |
157 | 154 | expect(same_commit).to be false |
158 | 155 | end |
159 | 156 |
|
160 | 157 | it 'checks if a tag and a commit hash point to the same commit' do |
161 | | - same_commit = described_class.point_to_same_commit?('1.0', commit_hash(commit_message: 'commit D'), remote_name: remote_name) |
| 158 | + same_commit = described_class.point_to_same_commit?('1.0', commit_hash(commit_message: 'commit D')) |
162 | 159 | expect(same_commit).to be false |
163 | 160 | end |
164 | 161 |
|
165 | 162 | it 'checks if a commit hash and a branch point to the same commit' do |
166 | | - same_commit = described_class.point_to_same_commit?(commit_hash(commit_message: 'commit B'), 'another-branch', remote_name: remote_name) |
| 163 | + same_commit = described_class.point_to_same_commit?(commit_hash(commit_message: 'commit B'), 'another-branch') |
167 | 164 | expect(same_commit).to be false |
168 | 165 | end |
169 | 166 |
|
170 | 167 | it 'checks if commits between the same branch point to the same commit' do |
171 | | - same_commit = described_class.point_to_same_commit?('feature-branch', 'feature-branch', remote_name: remote_name) |
| 168 | + same_commit = described_class.point_to_same_commit?('feature-branch', 'feature-branch') |
172 | 169 | expect(same_commit).to be true |
173 | 170 | end |
174 | 171 |
|
175 | 172 | it 'checks if commits between branches that have no difference point to the same commit' do |
176 | | - same_commit = described_class.point_to_same_commit?('another-branch', 'new-branch', remote_name: remote_name) |
| 173 | + same_commit = described_class.point_to_same_commit?('another-branch', 'new-branch') |
177 | 174 | expect(same_commit).to be true |
178 | 175 | end |
179 | 176 |
|
180 | 177 | it 'raises error for a non-existent base_ref' do |
181 | | - expect { described_class.point_to_same_commit?('non-existent', 'main', remote_name: remote_name) }.to raise_error(StandardError) |
| 178 | + expect { described_class.point_to_same_commit?('non-existent', 'main') }.to raise_error(StandardError) |
182 | 179 | end |
183 | 180 | end |
184 | 181 |
|
|
0 commit comments