aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_dependency_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_commands_dependency_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb46
1 files changed, 16 insertions, 30 deletions
diff --git a/test/rubygems/test_gem_commands_dependency_command.rb b/test/rubygems/test_gem_commands_dependency_command.rb
index 66e9d86d52..8463017d50 100644
--- a/test/rubygems/test_gem_commands_dependency_command.rb
+++ b/test/rubygems/test_gem_commands_dependency_command.rb
@@ -9,12 +9,13 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
@cmd = Gem::Commands::DependencyCommand.new
@cmd.options[:domain] = :local
- util_setup_fake_fetcher
+ util_setup_fake_fetcher true
end
def test_execute
quick_gem 'foo' do |gem|
gem.add_dependency 'bar', '> 1'
+ gem.add_dependency 'baz', '> 1'
end
Gem.source_index = nil
@@ -25,7 +26,8 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
@cmd.execute
end
- assert_equal "Gem foo-2\n bar (> 1, runtime)\n\n", @ui.output
+ assert_equal "Gem foo-2\n bar (> 1, runtime)\n baz (> 1, runtime)\n\n",
+ @ui.output
assert_equal '', @ui.error
end
@@ -41,6 +43,8 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
expected = <<-EOF
Gem a-1
+Gem a-2.a
+
Gem a-2
Gem a-3.a
@@ -100,6 +104,8 @@ Gem pl-1-x86-linux
expected = <<-EOF
Gem a-1
+Gem a-2.a
+
Gem a-2
Gem a-3.a
@@ -173,8 +179,7 @@ ERROR: Only reverse dependencies for local gems are supported.
util_setup_spec_fetcher foo
- FileUtils.rm File.join(@gemhome, 'specifications',
- "#{foo.full_name}.gemspec")
+ FileUtils.rm File.join(@gemhome, 'specifications', foo.spec_name)
@cmd.options[:args] = %w[foo]
@cmd.options[:domain] = :remote
@@ -187,43 +192,24 @@ ERROR: Only reverse dependencies for local gems are supported.
assert_equal '', @ui.error
end
- def test_execute_remote_legacy
- foo = quick_gem 'foo' do |gem|
- gem.add_dependency 'bar', '> 1'
- end
-
+ def test_execute_prerelease
@fetcher = Gem::FakeFetcher.new
Gem::RemoteFetcher.fetcher = @fetcher
- Gem::SpecFetcher.fetcher = nil
- si = util_setup_source_info_cache foo
-
- @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"
+ util_setup_spec_fetcher @a2_pre
- FileUtils.rm File.join(@gemhome, 'specifications',
- "#{foo.full_name}.gemspec")
+ FileUtils.rm File.join(@gemhome, 'specifications', @a2_pre.spec_name)
- @cmd.options[:args] = %w[foo]
+ @cmd.options[:args] = %w[a]
@cmd.options[:domain] = :remote
+ @cmd.options[:prerelease] = true
use_ui @ui do
@cmd.execute
end
- assert_equal "Gem foo-2\n bar (> 1, runtime)\n\n", @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
+ assert_equal "Gem a-2.a\n\n", @ui.output
+ assert_equal '', @ui.error
end
end