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')
|
2019-12-13 06:19:08 -05:00
|
|
|
refute_match '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
|
2019-02-14 07:59:03 -05:00
|
|
|
|
2016-04-27 20:33:08 -04:00
|
|
|
end
|