merge revision(s) 44333: [Backport #9282]

* lib/rubygems/commands/install_command.rb:  Restore gem install
	  --ignore-dependencies for remote gems

	* test/rubygems/test_gem_commands_install_command.rb:  Test for the
	  above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2013-12-23 07:13:17 +00:00
parent 0f7e52f990
commit 8680f4f8de
3 changed files with 60 additions and 5 deletions

View file

@ -533,6 +533,32 @@ ERROR: Possible alternatives: non_existent_with_hint
assert_match "1 gem installed", @ui.output
end
def test_install_gem_ignore_dependencies_both
spec = quick_spec 'a', 2
util_build_gem spec
FileUtils.mv spec.cache_file, @tempdir
@cmd.options[:ignore_dependencies] = true
@cmd.install_gem 'a', '>= 0'
assert_equal %w[a-2], @cmd.installed_specs.map { |s| s.full_name }
end
def test_install_gem_ignore_dependencies_remote
spec_fetcher do |fetcher|
fetcher.gem 'a', 2
end
@cmd.options[:ignore_dependencies] = true
@cmd.install_gem 'a', '>= 0'
assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name }
end
def test_parses_requirement_from_gemname
spec_fetcher do |fetcher|
fetcher.gem 'a', 2