Open3.capture2e raises exception when the command is not present.

This commit is contained in:
Hiroshi SHIBATA 2020-05-08 14:27:41 +09:00
parent ac2c07e983
commit da345adc1c
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -10,9 +10,11 @@ class TestGemExtCmakeBuilder < Gem::TestCase
# Details: https://github.com/rubygems/rubygems/issues/1270#issuecomment-177368340
skip "CmakeBuilder doesn't work on Windows." if Gem.win_platform?
_, status = Open3.capture2e('cmake')
skip 'cmake not present' unless status.success?
begin
_, status = Open3.capture2e('cmake')
rescue Errno::ENOENT
skip 'cmake not present'
end
@ext = File.join @tempdir, 'ext'
@dest_path = File.join @tempdir, 'prefix'