Merge pull request #17888 from Homebrew/bin-pathname-audit-bugs

rubocops/text: Allow all "#{bin}/foo" interpolated strings with spaces
This commit is contained in:
Issy Long 2024-07-28 17:44:59 +01:00 committed by GitHub
commit df6b06c57e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -158,6 +158,8 @@ module RuboCop
end
def path_starts_with_bin?(path, starts_with)
return false if path.include?(" ")
path_starts_with?(path, starts_with, bin: true)
end

View File

@ -150,6 +150,8 @@ RSpec.describe RuboCop::Cop::FormulaAuditStrict::Text do
class Foo < Formula
test do
shell_output("\#{bin}/foo --version")
assert_match "help", shell_output("\#{bin}/foo-something --help 2>&1")
assert_match "OK", shell_output("\#{bin}/foo-something_else --check 2>&1")
end
end
RUBY