Sha256: 43679cb3ba1ff51e1d6557ec9342bd89038fe9d5417012eefcd79633ccdafc2e

Contents?: true

Size: 727 Bytes

Versions: 5

Compression:

Stored size: 727 Bytes

Contents

# frozen_string_literal: true

require_relative "helper"

class TestGemRemoteFetchError < Gem::TestCase
  def test_password_redacted
    error = Gem::RemoteFetcher::FetchError.new("There was an error fetching", "https://user:secret@gemsource.org")
    refute_match %r{secret}, error.to_s
  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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubygems-update-3.4.22 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.4.21 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.4.20 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.4.19 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.4.18 test/rubygems/test_remote_fetch_error.rb