mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 05:25:34 +02:00
Merge rubygems master from upstream.
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
This commit is contained in:
parent
560cd5b1f0
commit
56660de3c6
55 changed files with 1051 additions and 1053 deletions
|
@ -7,11 +7,17 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
|
|||
def setup
|
||||
super
|
||||
|
||||
spec_fetcher
|
||||
|
||||
@cmd = Gem::Commands::SourcesCommand.new
|
||||
|
||||
@new_repo = "http://beta-gems.example.com"
|
||||
|
||||
@old_https_proxy_config = Gem.configuration[:http_proxy]
|
||||
end
|
||||
|
||||
def teardown
|
||||
Gem.configuration[:http_proxy] = @old_https_proxy_config
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
def test_initialize_proxy
|
||||
|
@ -69,6 +75,8 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_add_nonexistent_source
|
||||
spec_fetcher
|
||||
|
||||
uri = "http://beta-gems.example.com/specs.#{@marshal_version}.gz"
|
||||
@fetcher.data[uri] = proc do
|
||||
raise Gem::RemoteFetcher::FetchError.new('it died', uri)
|
||||
|
@ -92,6 +100,8 @@ Error fetching http://beta-gems.example.com:
|
|||
end
|
||||
|
||||
def test_execute_add_redundant_source
|
||||
spec_fetcher
|
||||
|
||||
@cmd.handle_options %W[--add #{@gem_repo}]
|
||||
|
||||
use_ui @ui do
|
||||
|
@ -109,6 +119,8 @@ source #{@gem_repo} already present in the cache
|
|||
end
|
||||
|
||||
def test_execute_add_redundant_source_trailing_slash
|
||||
spec_fetcher
|
||||
|
||||
# Remove pre-existing gem source (w/ slash)
|
||||
repo_with_slash = "http://gems.example.com/"
|
||||
@cmd.handle_options %W[--remove #{repo_with_slash}]
|
||||
|
@ -266,6 +278,8 @@ beta-gems.example.com is not a URI
|
|||
end
|
||||
|
||||
def test_execute_remove_no_network
|
||||
spec_fetcher
|
||||
|
||||
@cmd.handle_options %W[--remove #{@gem_repo}]
|
||||
|
||||
@fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] = proc do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue