Sha256: 38ad72f15c1a26a5d7d4c910e9bedf79090446ea7465e9b5ca908c3eb2d3227d

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 Bytes

Contents

# 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')
    refute_match error.to_s, 'secret'
  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

3 entries across 3 versions & 1 rubygems

Version Path
rubygems-update-3.1.0.pre3 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.1.0.pre2 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.1.0.pre1 test/rubygems/test_remote_fetch_error.rb