2016-04-27 20:33:08 -04:00
|
|
|
# frozen_string_literal: true
|
2021-06-01 23:32:47 -04:00
|
|
|
require_relative 'helper'
|
2016-04-27 20:33:08 -04:00
|
|
|
|
|
|
|
class TestRemoteFetchError < Gem::TestCase
|
|
|
|
def test_password_redacted
|
|
|
|
error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://user:secret@gemsource.org')
|
2021-05-11 03:45:31 -04: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
|