diff options
author | bronzdoc <lsagastume1990@gmail.com> | 2019-08-21 23:35:39 -0600 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-09-05 18:43:21 +0900 |
commit | b11cfed4c4fae51f7111c6cc0a3ec436a9c8faa3 (patch) | |
tree | d29205322ad97da192fc55ea59f7bcffdae1d6c2 /test/rubygems | |
parent | 400d693863cc8b500d9bcaee9529a395f3fe6da7 (diff) | |
download | bundler-b11cfed4c4fae51f7111c6cc0a3ec436a9c8faa3.tar.gz |
[rubygems/rubygems] Error out if there are multiple gemspecs and no gemspec is specified
https://github.com/rubygems/rubygems/commit/547947bbf0
Diffstat (limited to 'test/rubygems')
-rw-r--r-- | test/rubygems/test_gem_commands_build_command.rb | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb index 19575dcd9b..7540a0536e 100644 --- a/test/rubygems/test_gem_commands_build_command.rb +++ b/test/rubygems/test_gem_commands_build_command.rb @@ -293,19 +293,18 @@ class TestGemCommandsBuildCommand < Gem::TestCase use_ui @ui do Dir.chdir(gemspec_dir) do - @cmd.execute + assert_raises Gem::MockGemUi::TermError do + @cmd.execute + end end end - output = @ui.output.split("\n") - assert_equal " Successfully built RubyGem", output.shift - assert_equal " Name: another_gem", output.shift - assert_equal " Version: 2", output.shift - assert_equal " File: another_gem-2.gem", output.shift - assert_equal [], output + gemspecs = ["another_gem-2.gemspec", "some_gem-2.gemspec"] + assert_equal "", @ui.output + assert_equal @ui.error, "ERROR: Multiple gemspecs found: #{gemspecs}, please specify one\n" expected_gem = File.join(gemspec_dir, File.basename(another_gem.cache_file)) - assert File.exist?(expected_gem) + refute File.exist?(expected_gem) end def util_test_build_gem(gem) @@ -331,29 +330,6 @@ class TestGemCommandsBuildCommand < Gem::TestCase assert_equal "this is a summary", spec.summary end - def util_test_build_gem(gem) - use_ui @ui do - Dir.chdir @tempdir do - @cmd.execute - end - end - - output = @ui.output.split "\n" - assert_equal " Successfully built RubyGem", output.shift - assert_equal " Name: some_gem", output.shift - assert_equal " Version: 2", output.shift - assert_equal " File: some_gem-2.gem", output.shift - assert_equal [], output - - gem_file = File.join @tempdir, File.basename(gem.cache_file) - assert File.exist?(gem_file) - - spec = Gem::Package.new(gem_file).spec - - assert_equal "some_gem", spec.name - assert_equal "this is a summary", spec.summary - end - def test_execute_force gemspec_file = File.join(@tempdir, @gem.spec_name) |