summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_package_task.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-05-16 14:45:08 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-05 07:32:42 +0900
commit3660d14de60ac4a2b420601db5b16c104a0c7858 (patch)
treee461e2adcc5a5ef2fd6a0e138069dad0978f2723 /test/rubygems/test_gem_package_task.rb
parentf7d3522a54627b6d2fec0606fff5612ba52f2731 (diff)
downloadruby-3660d14de60ac4a2b420601db5b16c104a0c7858.tar.gz
[rubygems/rubygems] Make `rake package` log messages to stdout by default
The logging to $stderr is only happening due to a bug in `FileUtils`. Logging messages are not errors. https://github.com/rubygems/rubygems/commit/4d1b6659e6
Diffstat (limited to 'test/rubygems/test_gem_package_task.rb')
-rw-r--r--test/rubygems/test_gem_package_task.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_package_task.rb b/test/rubygems/test_gem_package_task.rb
index 56d574d9a3..9d87db88ae 100644
--- a/test/rubygems/test_gem_package_task.rb
+++ b/test/rubygems/test_gem_package_task.rb
@@ -47,6 +47,34 @@ class TestGemPackageTask < Gem::TestCase
end
end
+ def test_gem_package_prints_to_stdout_by_default
+ gem = Gem::Specification.new do |g|
+ g.name = "pkgr"
+ g.version = "1.2.3"
+
+ g.authors = %w[author]
+ g.files = %w[x]
+ g.summary = 'summary'
+ end
+
+ pkg = Gem::PackageTask.new(gem) do |p|
+ p.package_files << "y"
+ end
+
+ assert_equal %w[x y], pkg.package_files
+
+ Dir.chdir @tempdir do
+ FileUtils.touch 'x'
+ FileUtils.touch 'y'
+
+ _, err = capture_io do
+ Rake.application['package'].invoke
+ end
+
+ assert_empty err
+ end
+ end
+
def test_gem_package_with_current_platform
RakeFileUtils.verbose_flag = false