From fbb4b8d23505be46da7cd996d0c85039cf43b45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 6 Apr 2022 19:01:19 +0200 Subject: [PATCH] [rubygems/rubygems] Fix test errors when `cargo` not present Currently our tests try to detect whether `cargo` is installed or not, and if not, set tests that need `cargo` as pending. However, when this happens that test `setup` method is completely skipped, meaning that the `teardown` method will blow up when trying to switch back to the original folder, since it was not set. This commit fixes that. https://github.com/rubygems/rubygems/commit/1e4c1e6492 --- test/rubygems/test_gem_ext_cargo_builder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/rubygems/test_gem_ext_cargo_builder.rb b/test/rubygems/test_gem_ext_cargo_builder.rb index 0c8de2ff6c..ab80e5a6e1 100644 --- a/test/rubygems/test_gem_ext_cargo_builder.rb +++ b/test/rubygems/test_gem_ext_cargo_builder.rb @@ -11,10 +11,10 @@ class TestGemExtCargoBuilder < Gem::TestCase 'RUSTUP_HOME' => File.join(@orig_env['HOME'], '.rustup'), } + super + system(@rust_envs, 'cargo', '-V', out: IO::NULL, err: [:child, :out]) pend 'cargo not present' unless $?.success? - - super end def setup_rust_gem(name)