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
|
2021-08-22 06:06:02 -04:00
|
|
|
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
|
2021-08-22 06:06:02 -04:00
|
|
|
error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://::gemsource.org')
|
2016-04-27 20:33:08 -04:00
|
|
|
assert_equal error.to_s, 'There was an error fetching (https://::gemsource.org)'
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_to_s
|
2021-08-22 06:06:02 -04:00
|
|
|
error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://gemsource.org')
|
2016-04-27 20:33:08 -04:00
|
|
|
assert_equal error.to_s, 'There was an error fetching (https://gemsource.org)'
|
|
|
|
end
|
|
|
|
end
|