summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb2
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb2
-rw-r--r--test/rubygems/test_gem_resolver_best_set.rb6
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb2
-rw-r--r--test/rubygems/test_remote_fetch_error.rb6
-rw-r--r--test/rubygems/utilities.rb4
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]