Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add RemoteFetcher gzip behavior test, fix Gem.path test.

git-svn-id: http://rubygems.rubyforge.org/svn/trunk@1820 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information...
commit ffc852323dd2ae157d9c2838eda9b55820c1035d 1 parent bdc20cd
drbrain authored

Showing 2 changed files with 16 additions and 6 deletions. Show diff stats Hide diff stats

  1. +2 2 test/test_gem.rb
  2. +14 4 test/test_gem_remote_fetcher.rb
4 test/test_gem.rb
@@ -281,14 +281,14 @@ def test_self_path_APPLE_GEM_HOME_GEM_PATH
281 281 def test_self_path_ENV_PATH
282 282 Gem.send :set_paths, nil
283 283 path_count = Gem.path.size
284   - path_count -= 1 if defined? APPLE_GEM_HOME
285 284 Gem.clear_paths
286 285
287 286 ENV['GEM_PATH'] = @additional.join(File::PATH_SEPARATOR)
288 287
289 288 assert_equal @additional, Gem.path[0,2]
290 289
291   - assert_equal path_count + @additional.size, Gem.path.size
  290 + assert_equal path_count + @additional.size, Gem.path.size,
  291 + "extra path components: #{Gem.path[2..-1].inspect}"
292 292 assert_match Gem.dir, Gem.path.last
293 293 end
294 294
18 test/test_gem_remote_fetcher.rb
@@ -381,10 +381,20 @@ def test_explicit_proxy_with_user_auth_in_env
381 381 end
382 382 end
383 383
  384 + def test_fetch_path_gzip
  385 + fetcher = Gem::RemoteFetcher.new nil
  386 +
  387 + def fetcher.open_uri_or_path(uri, mtime, head = nil)
  388 + Gem.gzip 'foo'
  389 + end
  390 +
  391 + assert_equal 'foo', fetcher.fetch_path(@uri + 'foo.gz')
  392 + end
  393 +
384 394 def test_fetch_path_io_error
385 395 fetcher = Gem::RemoteFetcher.new nil
386 396
387   - def fetcher.open_uri_or_path(uri, mtime, i = 1)
  397 + def fetcher.open_uri_or_path(uri, mtime, head = nil)
388 398 raise EOFError
389 399 end
390 400
@@ -399,7 +409,7 @@ def fetcher.open_uri_or_path(uri, mtime, i = 1)
399 409 def test_fetch_path_socket_error
400 410 fetcher = Gem::RemoteFetcher.new nil
401 411
402   - def fetcher.open_uri_or_path(uri, mtime, hate = 2)
  412 + def fetcher.open_uri_or_path(uri, mtime, head = nil)
403 413 raise SocketError
404 414 end
405 415
@@ -414,7 +424,7 @@ def fetcher.open_uri_or_path(uri, mtime, hate = 2)
414 424 def test_fetch_path_system_call_error
415 425 fetcher = Gem::RemoteFetcher.new nil
416 426
417   - def fetcher.open_uri_or_path(uri, mtime = nil, drbrain = 3)
  427 + def fetcher.open_uri_or_path(uri, mtime = nil, head = nil)
418 428 raise Errno::ECONNREFUSED, 'connect(2)'
419 429 end
420 430
@@ -430,7 +440,7 @@ def fetcher.open_uri_or_path(uri, mtime = nil, drbrain = 3)
430 440 def test_fetch_path_unmodified
431 441 fetcher = Gem::RemoteFetcher.new nil
432 442
433   - def fetcher.open_uri_or_path(uri, mtime, tons = 4)
  443 + def fetcher.open_uri_or_path(uri, mtime, head = nil)
434 444 ''
435 445 end
436 446

0 comments on commit ffc8523

Please sign in to comment.
Something went wrong with that request. Please try again.