2016-04-27 20:33:08 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
require 'rubygems/test_case'
|
|
|
|
|
|
|
|
class TestRemoteFetchError < Gem::TestCase
|
|
|
|
def test_password_redacted
|
|
|
|
error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://user:secret@gemsource.org')
|
2020-02-19 01:10:29 -05:00
|
|
|
refute_match %r|secret|, error.to_s
|
2016-04-27 20:33:08 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_invalid_url
|
|
|
|
error = Gem::RemoteFetcher::FetchError.new('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.new('There was an error fetching', 'https://gemsource.org')
|
|
|
|
assert_equal error.to_s, 'There was an error fetching (https://gemsource.org)'
|
|
|
|
end
|
|
|
|
end
|