|
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" |
156 | 155 | env = { "HOME" => env_dir }
|
157 |
| - expect(execute("gem", ["source", "-r", "https://rubygems.org/"], env: env)).to exit_success |
158 |
| - expect(execute("gem", ["source", "-a", host], env: env)).to exit_success |
| 156 | + File.write(File.join(env_dir, ".gemrc"), "---\nsources:\n - #{host}\n") |
| 157 | + |
159 | 158 | expect(execute("gem", ["search", "-ar", "speaker"], env: env)).
|
160 | 159 | to exit_success.and_output(/speaker \(0.1.0\)/)
|
161 | 160 | end
|
162 | 161 |
|
163 | 162 | it "finds private gems when just the private source is configured with a trailing slash", db_transaction: false do
|
164 | 163 | env = { "HOME" => env_dir }
|
165 |
| - expect(execute("gem", ["source", "-r", "https://rubygems.org/"], env: env)).to exit_success |
166 |
| - expect(execute("gem", ["source", "-a", "#{host}/"], env: env)).to exit_success |
| 164 | + |
| 165 | + # The presence of `update_sources: true` in the .gemrc file breaks this test, and only this test. |
| 166 | + # Write a clean .gemrc file to avoid that. (This also makes the test much faster.) |
| 167 | + File.write(File.join(env_dir, ".gemrc"), "---\nsources:\n - #{host}/\n") |
| 168 | + |
167 | 169 | expect(execute("gem", ["search", "-ar", "speaker"], env: env)).
|
168 | 170 | to exit_success.and_output(/speaker \(0.1.0\)/)
|
169 | 171 | end
|
|
0 commit comments