diff options
author | Daniel Niknam <[email protected]> | 2021-08-22 20:06:02 +1000 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2021-08-31 19:06:14 +0900 |
commit | 589377fbdce9d281041535e3bf63f008689bb776 () | |
tree | 7eb9671d26a73517834f2e42ab206462229c5c57 /test | |
parent | a508693f06aefe30d2d83c9617541722ba6c8d66 (diff) |
[rubygems/rubygems] Refactor `Gem::RemoteFetcher::FetchError.build` back to its initialize method
https://.com/rubygems/rubygems/commit/21dcdd2dc5
Notes: Merged: https://.com/ruby/ruby/pull/4789
-rw-r--r-- | test/rubygems/test_gem_commands_sources_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_remote_fetcher.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_resolver_best_set.rb | 6 | ||||
-rw-r--r-- | test/rubygems/test_gem_spec_fetcher.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_remote_fetch_error.rb | 6 | ||||
-rw-r--r-- | test/rubygems/utilities.rb | 4 |
6 files changed, 11 insertions, 11 deletions
@@ -182,7 +182,7 @@ class TestGemCommandsSourcesCommand < Gem::TestCase uri = "http://beta-gems.example.com/specs.#{@marshal_version}.gz" @fetcher.data[uri] = proc do - raise Gem::RemoteFetcher::FetchError.build('it died', uri) end @cmd.handle_options %w[--add http://beta-gems.example.com] @@ -204,7 +204,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg== @test_data end - raise Gem::RemoteFetcher::FetchError.build("haha!", '') end end @@ -106,7 +106,7 @@ class TestGemResolverBestSet < Gem::TestCase error_uri = api_uri + 'a' - error = Gem::RemoteFetcher::FetchError.build 'bogus', error_uri set.replace_failed_api_set error @@ -124,7 +124,7 @@ class TestGemResolverBestSet < Gem::TestCase set.sets << index_set - error = Gem::RemoteFetcher::FetchError.build 'bogus', @gem_repo e = assert_raise Gem::RemoteFetcher::FetchError do set.replace_failed_api_set error @@ -145,7 +145,7 @@ class TestGemResolverBestSet < Gem::TestCase error_uri = api_uri + 'a' - error = Gem::RemoteFetcher::FetchError.build 'bogus', error_uri set.replace_failed_api_set error @@ -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.build("bad news from the internet", @uri) end Gem.sources.replace [src] @@ -3,17 +3,17 @@ require_relative 'helper' class TestRemoteFetchError < Gem::TestCase def test_password_redacted - error = Gem::RemoteFetcher::FetchError.build('There was an error fetching', 'https://user:[email protected]') refute_match %r{secret}, error.to_s end def test_invalid_url - error = Gem::RemoteFetcher::FetchError.build('There was an error fetching', 'https://::gemsource.org') assert_equal error.to_s, 'There was an error fetching (https://::gemsource.org)' end def test_to_s - error = Gem::RemoteFetcher::FetchError.build('There was an error fetching', 'https://gemsource.org') assert_equal error.to_s, 'There was an error fetching (https://gemsource.org)' end end @@ -51,7 +51,7 @@ class Gem::FakeFetcher raise ArgumentError, 'need full URI' unless path.start_with?("https://", "http://") unless @data.key? path - raise Gem::RemoteFetcher::FetchError.build("no data for #{path}", path) end if @data[path].kind_of?(Array) && @data[path].first.kind_of?(Array) @@ -124,7 +124,7 @@ class Gem::FakeFetcher raise ArgumentError, 'need full URI' unless path =~ %r{^http://} unless @data.key? path - raise Gem::RemoteFetcher::FetchError.build("no data for #{path}", path) end data = @data[path] |