mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 05:25:34 +02:00
Sync rubygems with current master (#2889)
This commit is contained in:
parent
930b012ad9
commit
96064e6f1c
Notes:
git
2020-03-24 15:39:48 +09:00
Merged-By: hsbt <hsbt@ruby-lang.org>
33 changed files with 434 additions and 559 deletions
|
@ -105,6 +105,22 @@ class TestGemCommandsContentsCommand < Gem::TestCase
|
|||
assert_empty @ui.error
|
||||
end
|
||||
|
||||
def test_execute_missing_version
|
||||
@cmd.options[:args] = %w[foo]
|
||||
@cmd.options[:version] = Gem::Requirement.new '= 2'
|
||||
|
||||
gem 'foo', 1
|
||||
|
||||
assert_raises Gem::MockGemUi::TermError do
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
end
|
||||
|
||||
assert_match "Unable to find gem 'foo'", @ui.output
|
||||
assert_empty @ui.error
|
||||
end
|
||||
|
||||
def test_execute_missing_multiple
|
||||
@cmd.options[:args] = %w[foo bar]
|
||||
|
||||
|
@ -152,6 +168,23 @@ class TestGemCommandsContentsCommand < Gem::TestCase
|
|||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
def test_execute_show_install_dir_latest_version
|
||||
@cmd.options[:args] = %w[foo]
|
||||
@cmd.options[:show_install_dir] = true
|
||||
|
||||
gem 'foo', 1
|
||||
gem 'foo', 2
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
expected = File.join @gemhome, 'gems', 'foo-2'
|
||||
|
||||
assert_equal "#{expected}\n", @ui.output
|
||||
assert_equal "", @ui.error
|
||||
end
|
||||
|
||||
def test_execute_show_install_dir_version
|
||||
@cmd.options[:args] = %w[foo]
|
||||
@cmd.options[:show_install_dir] = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue