ruby-changes:61752
From: David <ko1@a...>
Date: Wed, 17 Jun 2020 21:17:31 +0900 (JST)
Subject: [ruby-changes:61752] 3d8e0d8e50 (master): Skip `test_gem_package_task` if `rake` not present
https://git.ruby-lang.org/ruby.git/commit/?id=3d8e0d8e50 From 3d8e0d8e50bfafa523ad8fbbc7206712bb7de4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Tue, 16 Jun 2020 13:15:22 +0200 Subject: Skip `test_gem_package_task` if `rake` not present Instead of erroring. diff --git a/test/rubygems/test_gem_package_task.rb b/test/rubygems/test_gem_package_task.rb index 51b2e6c..24a1051 100644 --- a/test/rubygems/test_gem_package_task.rb +++ b/test/rubygems/test_gem_package_task.rb @@ -1,7 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package_task.rb#L1 # frozen_string_literal: true require 'rubygems/test_case' require 'rubygems' -require 'rubygems/package_task' + +begin + require 'rubygems/package_task' +rescue LoadError => e + raise unless e.path == 'rake/packagetask' +end + +unless defined?(Rake::PackageTask) + warn 'Skipping Gem::PackageTask tests. rake not found.' +end class TestGemPackageTask < Gem::TestCase @@ -107,4 +116,4 @@ class TestGemPackageTask < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package_task.rb#L116 assert_equal 'pkg/nokogiri-1.5.0-java', pkg.package_dir_path end -end +end if defined?(Rake::PackageTask) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/