1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use Bundler.unbundled_system for bug_report_templates tests

This commit removes the bundler deprecation warning below.
Since bug_report_templates test expect to use thier own gems inside of each file, not Rails's repository `Gemfile`.
Then using `Bundler.unbundled_system` should be right way.

* Deprecation warning without this commit

```
$ bundle exec rake test
--- Running bug_report_templates/generic_gem.rb
[DEPRECATED] `Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system` (called at /home/yahonda/src/github.com/rails/rails/guides/Rakefile:81)
```

* Steps to reproduce

```
git clone https://github.com/rails/rails
cd rails/guides
bundle install
bundle exec rake test
```

* Environment

```
$ ruby -v
ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-linux]
$ bundler -v
Bundler version 2.1.4
```

* Note

This bundler deprecation warning has been introduced since 2.2.0.rc.1 by this commit below.
https://github.com/rubygems/rubygems/commit/90741bef9e7
This commit is contained in:
Yasuo Honda 2021-06-01 08:29:00 +09:00
parent 58b46e9440
commit f936678b99

View file

@ -78,7 +78,7 @@ task :test do
templates = Dir.glob("bug_report_templates/*.rb")
counter = templates.count do |file|
puts "--- Running #{file}"
Bundler.clean_system(Gem.ruby, "-w", file) ||
Bundler.unbundled_system(Gem.ruby, "-w", file) ||
puts("+++ 💥 FAILED (exit #{$?.exitstatus})")
end
puts "+++ #{counter} / #{templates.size} templates executed successfully"