Skip to content

Commit 92ab2da

Browse files
nobumatzbot
authored andcommitted
[rubygems/rubygems] Check if failed with the expected error
rubygems/rubygems@3f22e9df8d
1 parent e345970 commit 92ab2da

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/rubygems/test_gem_ext_builder.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,15 @@ def self.expand(val, config = CONFIG); val; end
333333
f.puts "RbConfig::CONFIG['platform'] = 'fake_platform'"
334334
end
335335

336-
system(Gem.ruby, "-rmkmf", "-e", "exit MakeMakefile::RbConfig::CONFIG['host_os'] == 'fake_os'",
337-
"--", "--target-rbconfig=#{fake_rbconfig}")
338-
pend "This version of mkmf does not support --target-rbconfig" unless $?.success?
336+
stdout, stderr = capture_subprocess_io do
337+
system(Gem.ruby, "-rmkmf", "-e", "exit MakeMakefile::RbConfig::CONFIG['host_os'] == 'fake_os'",
338+
"--", "--target-rbconfig=#{fake_rbconfig}")
339+
end
340+
unless $?.success?
341+
assert_include(stderr, "uninitialized constant MakeMakefile::RbConfig")
342+
pend "This version of mkmf does not support --target-rbconfig"
343+
end
344+
assert_empty(stdout)
339345

340346
@spec.extensions << "extconf.rb"
341347
@builder = Gem::Ext::Builder.new @spec, "", Gem::TargetRbConfig.from_path(fake_rbconfig)

0 commit comments

Comments
 (0)