Skip to content

Commit

Permalink
[rubygems/rubygems] Check if failed with the expected error
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and matzbot committed Jun 20, 2024
1 parent e345970 commit 92ab2da
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/rubygems/test_gem_ext_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,15 @@ def self.expand(val, config = CONFIG); val; end
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)
Expand Down

0 comments on commit 92ab2da

Please sign in to comment.