diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-12 05:07:50 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-12 05:07:50 +0000 |
commit | 7f9bf068fcff9ca7d6a21711f31c5b8d6022dddf (patch) | |
tree | 2bf9d83db081c73e583aeaf9f30140732c43282a /test/rubygems/test_gem_commands_build_command.rb | |
parent | 53a5b276b8bc6e22a9fecc23dd99259e2d0e7fa4 (diff) |
Merge rubygems@21f12a8 from upstream.
* [BudlerVersionFinder] set .filter! and .compatible? to match only on major versions https://github.com/rubygems/rubygems/pull/2515
* Fix broken symlink that points to ../* https://github.com/rubygems/rubygems/pull/2516
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_build_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_build_command.rb | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb index 68b5724c61..ac82a408c7 100644 --- a/test/rubygems/test_gem_commands_build_command.rb +++ b/test/rubygems/test_gem_commands_build_command.rb @@ -22,7 +22,6 @@ class TestGemCommandsBuildCommand < Gem::TestCase end @gem = util_spec 'some_gem' do |s| - s.rubyforge_project = 'example' s.license = 'AGPL-3.0' s.files = ['README.md'] end @@ -37,11 +36,39 @@ class TestGemCommandsBuildCommand < Gem::TestCase assert @cmd.options[:strict] end + def test_options_filename + gemspec_file = File.join(@tempdir, @gem.spec_name) + + File.open gemspec_file, 'w' do |gs| + gs.write @gem.to_ruby + end + + @cmd.options[:args] = [gemspec_file] + @cmd.options[:output] = "test.gem" + + use_ui @ui do + Dir.chdir @tempdir do + @cmd.execute + end + end + + file = File.join(@tempdir, File::SEPARATOR, "test.gem") + assert File.exist?(file) + + 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: test.gem", output.shift + assert_equal [], output + end + def test_handle_options_defaults @cmd.handle_options [] refute @cmd.options[:force] refute @cmd.options[:strict] + assert_nil @cmd.options[:output] end def test_execute @@ -97,7 +124,6 @@ class TestGemCommandsBuildCommand < Gem::TestCase def test_execute_strict_with_warnings bad_gem = util_spec 'some_bad_gem' do |s| - s.rubyforge_project = 'example' s.files = ['README.md'] end |