summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_spec_fetcher.rb
diff options
context:
space:
mode:
authorDaniel Niknam <mhmd.niknam@gmail.com>2021-08-22 01:40:21 +1000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-08-31 19:06:14 +0900
commit3adc141a79cdab83671b7f68301901dd7726e7c4 (patch)
treef54b06d49939b7fe03358acdca0f5b178a583a12 /test/rubygems/test_gem_spec_fetcher.rb
parent19e1d3cdce96b9e58a0947b6fcbabd6da06cbd11 (diff)
downloadruby-3adc141a79cdab83671b7f68301901dd7726e7c4.tar.gz
[rubygems/rubygems] Refactor `Gem::RemoteFetcher::FetchError` initializer to `build` method
The `initialize` method is already doing a lot and by adding the `Gem::PrintableUri` to redact sensitive information, things are getting complicated and hard to read here. For the start, I have refactored the `initialize` method into a class method called `build`. https://github.com/rubygems/rubygems/commit/4312e8fdf5
Diffstat (limited to 'test/rubygems/test_gem_spec_fetcher.rb')
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_spec_fetcher.rb b/test/rubygems/test_gem_spec_fetcher.rb
index afae46e120..be862aa138 100644
--- a/test/rubygems/test_gem_spec_fetcher.rb
+++ b/test/rubygems/test_gem_spec_fetcher.rb
@@ -144,7 +144,7 @@ class TestGemSpecFetcher < Gem::TestCase
def test_spec_for_dependency_bad_fetch_spec
src = Gem::Source.new(@gem_repo)
def src.fetch_spec(name)
- raise Gem::RemoteFetcher::FetchError.new("bad news from the internet", @uri)
+ raise Gem::RemoteFetcher::FetchError.build("bad news from the internet", @uri)
end
Gem.sources.replace [src]