From c3546c76c8f1c9d61e65d08e8b2dfca2e2098736 Mon Sep 17 00:00:00 2001 From: hsbt Date: Thu, 5 Feb 2015 13:42:45 +0000 Subject: * lib/rubygems: Update to RubyGems HEAD(5c3b6f3). Fixed #1156, #1142, #1115, #1142, #1139 on rubygems/rubygems * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rubygems/test_gem_commands_open_command.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/rubygems/test_gem_commands_open_command.rb') diff --git a/test/rubygems/test_gem_commands_open_command.rb b/test/rubygems/test_gem_commands_open_command.rb index 25f22c81b3..c1c76f95c9 100644 --- a/test/rubygems/test_gem_commands_open_command.rb +++ b/test/rubygems/test_gem_commands_open_command.rb @@ -15,18 +15,24 @@ class TestGemCommandsOpenCommand < Gem::TestCase end write_file File.join(*%W[gems #{spec.full_name} lib #{name}.rb]) write_file File.join(*%W[gems #{spec.full_name} Rakefile]) + spec end def test_execute @cmd.options[:args] = %w[foo] @cmd.options[:editor] = "#{Gem.ruby} -e0 --" - gem 'foo' + spec = gem 'foo' + mock = MiniTest::Mock.new + mock.expect(:call, true, [spec.full_gem_path]) - use_ui @ui do - @cmd.execute + Dir.stub(:chdir, mock) do + use_ui @ui do + @cmd.execute + end end + assert mock.verify assert_equal "", @ui.error end -- cgit v1.2.3