aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_update_command.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-14 03:30:02 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-14 03:30:02 +0000
commit4de117a61517e839f2c45eaf45d56fc243d6d5b2 (patch)
tree7cb5af7a7eb513e5dddf5e343746b1611e628387 /test/rubygems/test_gem_commands_update_command.rb
parente548c09d429a5136285ea81aed418685359ed124 (diff)
downloadruby-4de117a61517e839f2c45eaf45d56fc243d6d5b2.tar.gz
* lib/rubygems: Update to RubyGems 2.4.1 master(713ab65)
Complete history at: https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_update_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb63
1 files changed, 63 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb
index d259383ba2..2b3bb56855 100644
--- a/test/rubygems/test_gem_commands_update_command.rb
+++ b/test/rubygems/test_gem_commands_update_command.rb
@@ -52,6 +52,30 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
assert_empty out
end
+ def test_execute_multiple
+ spec_fetcher do |fetcher|
+ fetcher.gem 'a', 2
+ fetcher.gem 'ab', 2
+
+ fetcher.clear
+
+ fetcher.spec 'a', 1
+ fetcher.spec 'ab', 1
+ end
+
+ @cmd.options[:args] = %w[a]
+
+ use_ui @ui do
+ @cmd.execute
+ end
+
+ out = @ui.output.split "\n"
+ assert_equal "Updating installed gems", out.shift
+ assert_equal "Updating a", out.shift
+ assert_equal "Gems updated: a", out.shift
+ assert_empty out
+ end
+
def test_execute_system
spec_fetcher do |fetcher|
fetcher.gem 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
@@ -266,6 +290,30 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
assert_empty out
end
+ def test_execute_named_some_up_to_date
+ spec_fetcher do |fetcher|
+ fetcher.gem 'a', 2
+ fetcher.clear
+ fetcher.spec 'a', 1
+
+ fetcher.spec 'b', 2
+ end
+
+ @cmd.options[:args] = %w[a b]
+
+ use_ui @ui do
+ @cmd.execute
+ end
+
+ out = @ui.output.split "\n"
+ assert_equal "Updating installed gems", out.shift
+ assert_equal "Updating a", out.shift
+ assert_equal "Gems updated: a", out.shift
+ assert_equal "Gems already up-to-date: b", out.shift
+
+ assert_empty out
+ end
+
def test_execute_named_up_to_date
spec_fetcher do |fetcher|
fetcher.spec 'a', 2
@@ -437,6 +485,21 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
assert_equal expected, @cmd.options
end
+ def test_update_gem_unresolved_dependency
+ spec_fetcher do |fetcher|
+ fetcher.spec 'a', 1
+ fetcher.gem 'a', 2 do |s|
+ s.add_dependency 'b', '>= 2'
+ end
+
+ fetcher.spec 'b', 1
+ end
+
+ @cmd.update_gem 'a'
+
+ assert_empty @cmd.updated
+ end
+
def test_update_rubygems_arguments
@cmd.options[:system] = true