summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_remote_fetcher.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-09 21:38:59 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-09 21:38:59 +0000
commit31c94ffeb5f09d09ac2c86fc9e6614e38251a43d (patch)
tree10e44506238c7af3d7c9d822111996731726e38d /test/rubygems/test_gem_remote_fetcher.rb
parenta6afbaeb3be396c0fdea3b9077d9256c59edcfca (diff)
Update to RubyGems 1.3.4 r2223
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_remote_fetcher.rb')
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
index 3f135ba046..465443c901 100644
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ b/test/rubygems/test_gem_remote_fetcher.rb
@@ -151,7 +151,7 @@ gems:
fetcher.fetch_size 'gems.example.com/yaml'
end
- assert_equal 'uri is not an HTTP URI', e.message
+ assert_equal 'uri scheme is invalid', e.message
end
def test_fetch_size_socket_error
@@ -237,6 +237,21 @@ gems:
inst.download(@a1, local_path)
end
+ def test_download_local_space
+ space_path = File.join @tempdir, 'space path'
+ FileUtils.mkdir space_path
+ FileUtils.mv @a1_gem, space_path
+ local_path = File.join space_path, "#{@a1.full_name}.gem"
+ inst = nil
+
+ Dir.chdir @tempdir do
+ inst = Gem::RemoteFetcher.fetcher
+ end
+
+ assert_equal File.join(@gemhome, 'cache', "#{@a1.full_name}.gem"),
+ inst.download(@a1, local_path)
+ end
+
def test_download_install_dir
a1_data = nil
File.open @a1_gem, 'rb' do |fp|
@@ -463,6 +478,13 @@ gems:
assert_equal nil, fetcher.fetch_path(URI.parse(@gem_repo), Time.at(0))
end
+ def test_get_proxy_from_env_auto_normalizes
+ fetcher = Gem::RemoteFetcher.new(nil)
+ ENV['HTTP_PROXY'] = 'fakeurl:12345'
+
+ assert_equal('http://fakeurl:12345', fetcher.get_proxy_from_env.to_s)
+ end
+
def test_get_proxy_from_env_empty
orig_env_HTTP_PROXY = ENV['HTTP_PROXY']
orig_env_http_proxy = ENV['http_proxy']