Sha256: 0b3602a2776378bc54f35836953869c5026d85a5d20a463c4c27a2ec5d3b9c39

Contents?: true

Size: 726 Bytes

Versions: 8

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 '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

8 entries across 8 versions & 1 rubygems

Version Path
rubygems-update-3.1.6 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.1.5 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.2.0.rc.1 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.1.4 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.1.3 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.1.2 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.1.1 test/rubygems/test_remote_fetch_error.rb
rubygems-update-3.1.0 test/rubygems/test_remote_fetch_error.rb