[rubygems/rubygems] Fix `rake check_manifest` when `rake` is `--user-installed`'d

Otherwise we get

```
✗ rake TEST=test/rubygems/test_project_sanity.rb
Loaded suite /Users/deivid/.gem/ruby/3.2.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
E
============================================================================================================================================================================================================
Error: test_manifest_is_up_to_date(TestProjectSanity):
  RuntimeError: There was an error running `rake check_manifest`: /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems.rb:263:in `find_spec_for_exe': can't find gem rake (>= 0.a) with executable rake (Gem::GemNotFoundException)
  	from /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems.rb:282:in `activate_bin_path'
  	from /Users/deivid/.asdf/installs/ruby/3.2.1/bin/rake:25:in `<main>'
/Users/deivid/Code/rubygems/rubygems/test/rubygems/test_project_sanity.rb:27:in `test_manifest_is_up_to_date'
     24:
     25:         raise "Expected Manifest.txt to be up to date, but it's not. Run `rake update_manifest` to sync it."
     26:       else
  => 27:         raise "There was an error running `rake check_manifest`: #{out}"
     28:       end
     29:     end
     30:   end
============================================================================================================================================================================================================
.
Finished in 0.188192 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 tests, 1 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
50% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10.63 tests/s, 5.31 assertions/s
rake aborted!
```

https://github.com/rubygems/rubygems/commit/29829933a6
This commit is contained in:
David Rodríguez 2023-03-14 13:28:28 +01:00 коммит произвёл Hiroshi SHIBATA
Родитель 37c2e903e8
Коммит 5733828734
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -4,6 +4,12 @@ require_relative "helper"
require "open3"
class TestProjectSanity < Gem::TestCase
def setup
end
def teardown
end
def test_manifest_is_up_to_date
pend unless File.exist?("#{root}/Rakefile")