mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-15 19:56:59 +08:00
25 lines
582 B
Ruby
25 lines
582 B
Ruby
# typed: false
|
|
# frozen_string_literal: true
|
|
|
|
require "utils/fork"
|
|
|
|
describe Utils do
|
|
describe "#safe_fork" do
|
|
it "raises a RuntimeError on an error that isn't ErrorDuringExecution" do
|
|
expect {
|
|
described_class.safe_fork do
|
|
raise "this is an exception in the child"
|
|
end
|
|
}.to raise_error(RuntimeError)
|
|
end
|
|
|
|
it "raises an ErrorDuringExecution on one in the child" do
|
|
expect {
|
|
described_class.safe_fork do
|
|
safe_system "/usr/bin/false"
|
|
end
|
|
}.to raise_error(ErrorDuringExecution)
|
|
end
|
|
end
|
|
end
|