diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-11 20:57:02 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-11 20:57:02 +0000 |
commit | e72b71d56a1f369cb7eb3892c61715460bac8109 () | |
tree | 6f55131cbd153845e71dadc91f08636aa6707423 /test | |
parent | 0ae6c7f816cbc3ba0cdd97f609b9ffcbf49bf9bb (diff) |
Update to RubyGems 1.1.1 r1701.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/rubygems/gemutilities.rb | 13 | ||||
-rw-r--r-- | test/rubygems/test_gem.rb | 79 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_environment_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_query_command.rb | 11 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_sources_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_update_command.rb | 1 | ||||
-rw-r--r-- | test/rubygems/test_gem_dependency_installer.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_remote_fetcher.rb | 5 | ||||
-rw-r--r-- | test/rubygems/test_gem_server.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_source_index.rb | 22 | ||||
-rw-r--r-- | test/rubygems/test_gem_source_info_cache.rb | 23 | ||||
-rw-r--r-- | test/rubygems/test_open_uri.rb | 13 |
12 files changed, 131 insertions, 44 deletions
@@ -61,6 +61,8 @@ class FakeFetcher name = "#{spec.full_name}.gem" path = File.join(install_dir, 'cache', name) if source_uri =~ /^http/ then File.open(path, "wb") do |f| f.write fetch_path(File.join(source_uri, "gems", name)) @@ -369,6 +371,17 @@ class RubyGemTestCase < Test::Unit::TestCase Gem.win_platform? end end class TempIO @@ -237,23 +237,25 @@ class TestGem < RubyGemTestCase assert_equal [Gem.dir], Gem.path end - def test_self_path_APPLE_GEM_HOME - Gem.clear_paths - Gem.const_set :APPLE_GEM_HOME, '/tmp/apple_gem_home' - - assert Gem.path.include?('/tmp/apple_gem_home') - ensure - Gem.send :remove_const, :APPLE_GEM_HOME - end - - def test_self_path_APPLE_GEM_HOME_GEM_PATH - Gem.clear_paths - ENV['GEM_PATH'] = @gemhome - Gem.const_set :APPLE_GEM_HOME, '/tmp/apple_gem_home' - - assert !Gem.path.include?('/tmp/apple_gem_home') - ensure - Gem.send :remove_const, :APPLE_GEM_HOME end def test_self_path_ENV_PATH @@ -303,21 +305,56 @@ class TestGem < RubyGemTestCase def test_self_prefix file_name = File.expand_path __FILE__ - assert_equal File.dirname(File.dirname(file_name)), Gem.prefix end - def test_self_prefix_odd orig_sitelibdir = Gem::ConfigMap[:sitelibdir] file_name = File.expand_path __FILE__ - prefix = File.join File.dirname(File.dirname(file_name)), 'lib' - Gem::ConfigMap[:sitelibdir] = prefix.sub(/[\w]\//, '\&/') assert_nil Gem.prefix ensure Gem::ConfigMap[:sitelibdir] = orig_sitelibdir end def test_self_required_location util_make_gems @@ -20,7 +20,7 @@ class TestGemCommandsEnvironmentCommand < RubyGemTestCase @cmd.execute end - assert_match %r|RUBYGEMS VERSION: (\d\.)+\d \((\d\.)+\d\)|, @ui.output assert_match %r|RUBY VERSION: \d\.\d\.\d \(.*\) \[.*\]|, @ui.output assert_match %r|INSTALLATION DIRECTORY: #{Regexp.escape @gemhome}|, @ui.output @@ -26,6 +26,7 @@ class TestGemCommandsQueryCommand < RubyGemTestCase cache.update cache.write_cache cache.reset_cache_data a2_name = @a2.full_name @fetcher.data["#{@gem_repo}/quick/latest_index.rz"] = util_zip a2_name @@ -43,6 +44,9 @@ class TestGemCommandsQueryCommand < RubyGemTestCase *** REMOTE GEMS *** a (2) EOF @@ -55,6 +59,7 @@ a (2) cache.update cache.write_cache cache.reset_cache_data a1_name = @a1.full_name a2_name = @a2.full_name @@ -76,8 +81,8 @@ a (2) *** REMOTE GEMS *** -Updating metadata for 1 gems from http://gems.example.com/ -. complete a (2, 1) EOF @@ -97,7 +102,7 @@ a (2, 1) *** REMOTE GEMS *** -a (2, 1) This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. @@ -181,6 +181,8 @@ beta-gems.example.com is not a URI @cmd.handle_options %w[--update] util_setup_source_info_cache util_setup_fake_fetcher si = Gem::SourceIndex.new si.add_spec @a1 @@ -97,6 +97,7 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase assert_equal "Updating installed gems", out.shift assert_match %r|Bulk updating|, out.shift assert_equal "Updating #{@a2.name}", out.shift assert_equal "Successfully installed #{@c2.full_name}", out.shift assert_equal "Successfully installed #{@b2.full_name}", out.shift assert_equal "Successfully installed #{@a2.full_name}", out.shift @@ -216,6 +216,8 @@ class TestGemDependencyInstaller < RubyGemTestCase assert File.exist?(File.join(gemhome2, 'specifications', "#{@a1.full_name}.gemspec")) end def test_install_domain_both @@ -76,8 +76,9 @@ gems: # don't let 1.8 and 1.9 autotest collide RUBY_VERSION =~ /(\d+)\.(\d+)\.(\d+)/ - PROXY_PORT = 12345 + $1.to_i * 100 + $2.to_i * 10 + $3.to_i - SERVER_PORT = 23456 + $1.to_i * 100 + $2.to_i * 10 + $3.to_i def setup super @@ -15,7 +15,7 @@ class TestGemServer < RubyGemTestCase @a1 = quick_gem 'a', '1' - @server = Gem::Server.new Gem.dir, 8809, false @req = WEBrick::HTTPRequest.new :Logger => nil @res = WEBrick::HTTPResponse.new :HTTPVersion => '1.0' end @@ -395,13 +395,31 @@ class TestGemSourceIndex < RubyGemTestCase assert_equal [updated_platform.name], @source_index.outdated end def test_remove_extra @source_index.add_spec @a1 @source_index.add_spec @a2 - @source_index.remove_extra [@a1.full_name] - assert_equal [@a1.full_name], @source_index.gems.map { |n,s| n } end def test_remove_extra_no_changes @@ -287,6 +287,7 @@ class TestGemSourceInfoCache < RubyGemTestCase @sic.set_cache_data @gem_repo => sice @sic.update @sic.write_cache @sic.reset_cache_data @@ -358,6 +359,7 @@ class TestGemSourceInfoCache < RubyGemTestCase @sic.set_cache_data({@gem_repo => @sice_new}) @sic.update @sic.write_cache assert File.exist?(@sic.user_cache_file), 'user_cache_file' assert File.exist?(@sic.latest_user_cache_file), @@ -383,6 +385,7 @@ class TestGemSourceInfoCache < RubyGemTestCase @sic.set_cache_data({ @gem_repo => @sice }) @sic.update @sic.write_cache assert File.exist?(@sic.user_cache_file), 'system_cache_file' @@ -390,7 +393,7 @@ class TestGemSourceInfoCache < RubyGemTestCase 'latest_system_cache_file' user_cache_data = read_cache(@sic.user_cache_file).to_a.sort - assert_equal 1, user_cache_data.length user_cache_data = user_cache_data.first assert_equal @gem_repo, user_cache_data.first @@ -417,6 +420,24 @@ class TestGemSourceInfoCache < RubyGemTestCase assert_equal [[@gem_repo, @sys_sice]], read_cache(@sic.system_cache_file).to_a.sort assert_equal [[@gem_repo, @sice_new]], read_cache(@sic.user_cache_file).to_a.sort end @@ -1,13 +0,0 @@ -require 'test/unit' -require 'rubygems/gem_open_uri' - -class TestOpenURI < Test::Unit::TestCase - - def test_open_uri_not_broken - assert_nothing_raised do - open __FILE__ do end - end - end - -end - |