[rubygems/rubygems] Check if failed with the expected error

3f22e9df8d
This commit is contained in:
Nobuyoshi Nakada 2024-06-20 11:33:06 +09:00 committed by git
parent e345970707
commit 92ab2dac22

View file

@ -333,9 +333,15 @@ install:
f.puts "RbConfig::CONFIG['platform'] = 'fake_platform'"
end
system(Gem.ruby, "-rmkmf", "-e", "exit MakeMakefile::RbConfig::CONFIG['host_os'] == 'fake_os'",
"--", "--target-rbconfig=#{fake_rbconfig}")
pend "This version of mkmf does not support --target-rbconfig" unless $?.success?
stdout, stderr = capture_subprocess_io do
system(Gem.ruby, "-rmkmf", "-e", "exit MakeMakefile::RbConfig::CONFIG['host_os'] == 'fake_os'",
"--", "--target-rbconfig=#{fake_rbconfig}")
end
unless $?.success?
assert_include(stderr, "uninitialized constant MakeMakefile::RbConfig")
pend "This version of mkmf does not support --target-rbconfig"
end
assert_empty(stdout)
@spec.extensions << "extconf.rb"
@builder = Gem::Ext::Builder.new @spec, "", Gem::TargetRbConfig.from_path(fake_rbconfig)