brew/Library/Homebrew/test/utils/fork_spec.rb
Douglas Eichelberger 9075cbae62 brew style --fix
2023-04-21 09:58:50 -07:00

24 lines
573 B
Ruby

# 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 do
described_class.safe_fork do
raise "this is an exception in the child"
end
end.to raise_error(RuntimeError)
end
it "raises an ErrorDuringExecution on one in the child" do
expect do
described_class.safe_fork do
safe_system "/usr/bin/false"
end
end.to raise_error(ErrorDuringExecution)
end
end
end