summaryrefslogtreecommitdiff
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.rb29
1 files changed, 19 insertions, 10 deletions
diff --git a/test/rubygems/test_gem_commands_dependency_command.rb b/test/rubygems/test_gem_commands_dependency_command.rb
index 665cd98..d3f2b68 100644
--- a/test/rubygems/test_gem_commands_dependency_command.rb
+++ b/test/rubygems/test_gem_commands_dependency_command.rb
@@ -24,8 +24,6 @@ class TestGemCommandsDependencyCommand < Gem::TestCase
gem.add_dependency 'baz', '> 1'
end
- Gem.source_index = nil
-
@cmd.options[:args] = %w[foo]
use_ui @ui do
@@ -38,8 +36,6 @@ class TestGemCommandsDependencyCommand < Gem::TestCase
end
def test_execute_no_args
- Gem.source_index = nil
-
@cmd.options[:args] = []
use_ui @ui do
@@ -99,8 +95,6 @@ Gem pl-1-x86-linux
end
def test_execute_regexp
- Gem.source_index = nil
-
@cmd.options[:args] = %w[/[ab]/]
use_ui @ui do
@@ -136,8 +130,6 @@ Gem b-2
gem.add_dependency 'foo'
end
- Gem.source_index = nil
-
@cmd.options[:args] = %w[foo]
@cmd.options[:reverse_dependencies] = true
@@ -199,14 +191,31 @@ ERROR: Only reverse dependencies for local gems are supported.
assert_equal '', @ui.error
end
+ def test_execute_remote_version
+ @fetcher = Gem::FakeFetcher.new
+ Gem::RemoteFetcher.fetcher = @fetcher
+
+ util_setup_spec_fetcher @a1, @a2
+
+ @cmd.options[:args] = %w[a]
+ @cmd.options[:domain] = :remote
+ @cmd.options[:version] = req '= 1'
+
+ use_ui @ui do
+ @cmd.execute
+ end
+
+ assert_equal "Gem a-1\n\n", @ui.output
+ assert_equal '', @ui.error
+ end
+
def test_execute_prerelease
@fetcher = Gem::FakeFetcher.new
Gem::RemoteFetcher.fetcher = @fetcher
+ util_clear_gems
util_setup_spec_fetcher @a2_pre
- FileUtils.rm File.join(@gemhome, 'specifications', @a2_pre.spec_name)
-
@cmd.options[:args] = %w[a]
@cmd.options[:domain] = :remote
@cmd.options[:prerelease] = true