Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Library/Homebrew/test/utils/fork_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@
)
end
end

it "preserves an ErrorDuringExecution with a Pathname command" do
error = ErrorDuringExecution.new([Pathname("/usr/bin/false"), "arg"], status: 1)

IO.pipe do |reader, writer|
described_class.report_forked_child_error(writer, error)

expect(described_class.rewrite_child_error(JSON.parse(reader.read))).to have_attributes(
class: ErrorDuringExecution,
cmd: ["/usr/bin/false", "arg"],
)
end
end
end

describe "#safe_fork" do
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/utils/fork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def self.report_forked_child_error(error_pipe, error)
coder = JSON::Coder.new do |object|
case object
when Exception then child_error_hash(object)
when Pathname then object.to_s
else object
end
end
Expand Down
Loading