|
152 | 152 | end
|
153 | 153 |
|
154 | 154 | it "finds private gems when just the private source is configured", db_transaction: false do
|
155 |
| - skip "this doesn't work because Rubygems sends /specs.4.8.gz instead of /private/specs.4.8.gz" |
| 155 | + File.write(File.join(env_dir, ".gemrc"), "---\nsources:\n - #{host}\n") |
156 | 156 | env = { "HOME" => env_dir }
|
| 157 | + |
| 158 | + # This way of adjusting sources is required for ruby 3.2 and 3.1 to pass. |
157 | 159 | expect(execute("gem", ["source", "-r", "https://rubygems.org/"], env: env)).to exit_success
|
158 | 160 | expect(execute("gem", ["source", "-a", host], env: env)).to exit_success
|
| 161 | + |
159 | 162 | expect(execute("gem", ["search", "-ar", "speaker"], env: env)).
|
160 | 163 | to exit_success.and_output(/speaker \(0.1.0\)/)
|
161 | 164 | end
|
162 | 165 |
|
163 | 166 | it "finds private gems when just the private source is configured with a trailing slash", db_transaction: false do
|
| 167 | + # The presence of `update_sources: true` in the .gemrc file breaks this test, and only this test. |
| 168 | + # Write a clean .gemrc file to avoid that. (This also makes the test much faster.) |
| 169 | + File.write(File.join(env_dir, ".gemrc"), "---\nsources:\n - #{host}/\n") |
164 | 170 | env = { "HOME" => env_dir }
|
| 171 | + |
| 172 | + # This way of adjusting sources is required for ruby 3.2 and 3.1 to pass. |
165 | 173 | expect(execute("gem", ["source", "-r", "https://rubygems.org/"], env: env)).to exit_success
|
166 | 174 | expect(execute("gem", ["source", "-a", "#{host}/"], env: env)).to exit_success
|
| 175 | + |
167 | 176 | expect(execute("gem", ["search", "-ar", "speaker"], env: env)).
|
168 | 177 | to exit_success.and_output(/speaker \(0.1.0\)/)
|
169 | 178 | end
|
|
0 commit comments