diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-22 02:52:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-22 02:52:35 +0000 |
commit | b551e8c8b36766651be4e782e09e3b02e7d14a10 (patch) | |
tree | e164a1ef908bd4451568abf05b688f1593915b81 /test/rubygems/test_gem_commands_query_command.rb | |
parent | 65544f575b25b18dc27f9364f973556ddb48538f (diff) | |
download | ruby-b551e8c8b36766651be4e782e09e3b02e7d14a10.tar.gz |
* lib/rubygems: update to 1.3.6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_query_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_query_command.rb | 77 |
1 files changed, 22 insertions, 55 deletions
diff --git a/test/rubygems/test_gem_commands_query_command.rb b/test/rubygems/test_gem_commands_query_command.rb index c47e5bf613..b56b33b639 100644 --- a/test/rubygems/test_gem_commands_query_command.rb +++ b/test/rubygems/test_gem_commands_query_command.rb @@ -58,6 +58,28 @@ pl (1) assert_equal '', @ui.error end + def test_execute_all_prerelease + a1_name = @a1.full_name + a2_name = @a2.full_name + + @cmd.handle_options %w[-r --all --prerelease] + + use_ui @ui do + @cmd.execute + end + + expected = <<-EOF + +*** REMOTE GEMS *** + +a (3.a, 2, 1) +pl (1) + EOF + + assert_equal expected, @ui.output + assert_equal '', @ui.error + end + def test_execute_details @a2.summary = 'This is a lot of text. ' * 4 @a2.authors = ['Abraham Lincoln', 'Hirohito'] @@ -216,61 +238,6 @@ pl (1) assert_equal 1, e.exit_code end - def test_execute_legacy - Gem::SpecFetcher.fetcher = nil - si = util_setup_source_info_cache @a1, @a2, @pl1 - - @fetcher.data["#{@gem_repo}yaml"] = YAML.dump si - @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] = - si.dump - - @fetcher.data.delete "#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz" - - @cmd.handle_options %w[-r] - - use_ui @ui do - @cmd.execute - end - - expected = <<-EOF - -*** REMOTE GEMS *** - -a (2) -pl (1) - EOF - - assert_equal expected, @ui.output - - expected = <<-EOF -WARNING: RubyGems 1.2+ index not found for: -\t#{@gem_repo} - -RubyGems will revert to legacy indexes degrading performance. - EOF - - assert_equal expected, @ui.error - end - - def test_execute_legacy_prerelease - Gem::SpecFetcher.fetcher = nil - si = util_setup_source_info_cache @a1, @a2, @pl1 - - @fetcher.data["#{@gem_repo}yaml"] = YAML.dump si - @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] = - si.dump - - @fetcher.data.delete "#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz" - - @cmd.handle_options %w[-r --prerelease] - - e = assert_raises Gem::OperationNotSupportedError do - @cmd.execute - end - - assert_equal 'Prereleases not supported on legacy repositories', e.message - end - def test_execute_local_details @a3a.summary = 'This is a lot of text. ' * 4 @a3a.authors = ['Abraham Lincoln', 'Hirohito'] |