brew/Library/Homebrew/test/utils/fork_spec.rb
Issy Long 3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00

25 lines
588 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 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