From 2225af5bef50cc47a3f4e0f22a3bdf333e6b139b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Kryger?= Date: Fri, 25 Oct 2024 15:26:03 +0100 Subject: [PATCH] Revert "Disable audit_result in inreplace" This reverts commit f31e93a73aab025e60a4a798031c73327cef45cb. --- Library/Homebrew/test/utils/inreplace_spec.rb | 2 +- Library/Homebrew/utils/inreplace.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/test/utils/inreplace_spec.rb b/Library/Homebrew/test/utils/inreplace_spec.rb index ba1e825a35..a6b0a044b5 100644 --- a/Library/Homebrew/test/utils/inreplace_spec.rb +++ b/Library/Homebrew/test/utils/inreplace_spec.rb @@ -25,7 +25,7 @@ RSpec.describe Utils::Inreplace do it "raises error if there is nothing to replace" do expect do described_class.inreplace file.path, "d", "f" - end.not_to raise_error(Utils::Inreplace::Error) + end.to raise_error(Utils::Inreplace::Error) end it "raises error if there is nothing to replace in block form" do diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index 504fa6748c..a7e3e9bddf 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -50,7 +50,7 @@ module Utils block: T.nilable(T.proc.params(s: StringInreplaceExtension).void), ).void } - def self.inreplace(paths, before = nil, after = nil, audit_result: false, &block) + def self.inreplace(paths, before = nil, after = nil, audit_result: true, &block) paths = Array(paths) after &&= after.to_s before = before.to_s if before.is_a?(Pathname)