rubocop: trailing comma in multiline method calls

Discussed in
https://github.com/Homebrew/brew/pull/1987/files#r100693581.

This was originally ommitted because it wasn't compatible with Ruby 1.8.
(See https://github.com/Homebrew/legacy-homebrew/pull/48144#r49928971).
This commit is contained in:
Alyssa Ross 2017-02-12 15:06:54 +00:00
parent 76dfe030c7
commit 9e97eadccb
28 changed files with 109 additions and 107 deletions

View File

@ -168,6 +168,8 @@ Style/TernaryParentheses:
# makes diffs nicer # makes diffs nicer
Style/TrailingCommaInLiteral: Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma EnforcedStyleForMultiline: comma
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/VariableNumber: Style/VariableNumber:
Enabled: false Enabled: false

View File

@ -19,7 +19,7 @@ describe "Accessibility Access" do
expect(fake_system_command).to receive(:run!).with( expect(fake_system_command).to receive(:run!).with(
"/usr/bin/touch", "/usr/bin/touch",
args: [Hbc.pre_mavericks_accessibility_dotfile], args: [Hbc.pre_mavericks_accessibility_dotfile],
sudo: true sudo: true,
) )
shutup do shutup do
@ -41,7 +41,7 @@ describe "Accessibility Access" do
expect(fake_system_command).to receive(:run!).with( expect(fake_system_command).to receive(:run!).with(
"/usr/bin/sqlite3", "/usr/bin/sqlite3",
args: [Hbc.tcc_db, "INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','com.example.BasicCask',0,1,1,NULL);"], args: [Hbc.tcc_db, "INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','com.example.BasicCask',0,1,1,NULL);"],
sudo: true sudo: true,
) )
shutup do shutup do
@ -53,7 +53,7 @@ describe "Accessibility Access" do
expect(fake_system_command).to receive(:run!).with( expect(fake_system_command).to receive(:run!).with(
"/usr/bin/sqlite3", "/usr/bin/sqlite3",
args: [Hbc.tcc_db, "DELETE FROM access WHERE client='com.example.BasicCask';"], args: [Hbc.tcc_db, "DELETE FROM access WHERE client='com.example.BasicCask';"],
sudo: true sudo: true,
) )
shutup do shutup do

View File

@ -18,7 +18,7 @@ describe Hbc::Artifact::Pkg do
"/usr/sbin/installer", "/usr/sbin/installer",
args: ["-pkg", cask.staged_path.join("MyFancyPkg", "Fancy.pkg"), "-target", "/"], args: ["-pkg", cask.staged_path.join("MyFancyPkg", "Fancy.pkg"), "-target", "/"],
sudo: true, sudo: true,
print_stdout: true print_stdout: true,
) )
shutup do shutup do
@ -60,7 +60,7 @@ describe Hbc::Artifact::Pkg do
"/usr/sbin/installer", "/usr/sbin/installer",
args: ["-pkg", cask.staged_path.join("MyFancyPkg", "Fancy.pkg"), "-target", "/", "-applyChoiceChangesXML", cask.staged_path.join("/tmp/choices.xml")], args: ["-pkg", cask.staged_path.join("MyFancyPkg", "Fancy.pkg"), "-target", "/", "-applyChoiceChangesXML", cask.staged_path.join("/tmp/choices.xml")],
sudo: true, sudo: true,
print_stdout: true print_stdout: true,
) )
shutup do shutup do

View File

@ -44,12 +44,12 @@ describe Hbc::Artifact::Uninstall do
it "can uninstall" do it "can uninstall" do
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
launchctl_list_cmd, launchctl_list_cmd,
service_info service_info,
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
sudo(launchctl_list_cmd), sudo(launchctl_list_cmd),
unknown_response unknown_response,
) )
Hbc::FakeSystemCommand.expects_command(launchctl_remove_cmd) Hbc::FakeSystemCommand.expects_command(launchctl_remove_cmd)
@ -62,12 +62,12 @@ describe Hbc::Artifact::Uninstall do
it "can uninstall" do it "can uninstall" do
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
launchctl_list_cmd, launchctl_list_cmd,
unknown_response unknown_response,
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
sudo(launchctl_list_cmd), sudo(launchctl_list_cmd),
service_info service_info,
) )
Hbc::FakeSystemCommand.expects_command(sudo(launchctl_remove_cmd)) Hbc::FakeSystemCommand.expects_command(sudo(launchctl_remove_cmd))
@ -125,7 +125,7 @@ describe Hbc::Artifact::Uninstall do
it "can uninstall" do it "can uninstall" do
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%w[/usr/sbin/pkgutil --pkgs=my.fancy.package.*], %w[/usr/sbin/pkgutil --pkgs=my.fancy.package.*],
"#{main_pkg_id}\n#{agent_pkg_id}" "#{main_pkg_id}\n#{agent_pkg_id}",
) )
[ [
@ -134,28 +134,28 @@ describe Hbc::Artifact::Uninstall do
].each do |pkg_id, pkg_files, pkg_dirs| ].each do |pkg_id, pkg_files, pkg_dirs|
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%W[/usr/sbin/pkgutil --only-files --files #{pkg_id}], %W[/usr/sbin/pkgutil --only-files --files #{pkg_id}],
pkg_files.join("\n") pkg_files.join("\n"),
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%W[/usr/sbin/pkgutil --only-dirs --files #{pkg_id}], %W[/usr/sbin/pkgutil --only-dirs --files #{pkg_id}],
pkg_dirs.join("\n") pkg_dirs.join("\n"),
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%W[/usr/sbin/pkgutil --files #{pkg_id}], %W[/usr/sbin/pkgutil --files #{pkg_id}],
(pkg_files + pkg_dirs).join("\n") (pkg_files + pkg_dirs).join("\n"),
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%W[/usr/sbin/pkgutil --pkg-info-plist #{pkg_id}], %W[/usr/sbin/pkgutil --pkg-info-plist #{pkg_id}],
pkg_info_plist pkg_info_plist,
) )
Hbc::FakeSystemCommand.expects_command(sudo(%W[/usr/sbin/pkgutil --forget #{pkg_id}])) Hbc::FakeSystemCommand.expects_command(sudo(%W[/usr/sbin/pkgutil --forget #{pkg_id}]))
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -f --] + pkg_files.map { |path| Pathname("/tmp/#{path}") }) sudo(%w[/bin/rm -f --] + pkg_files.map { |path| Pathname("/tmp/#{path}") }),
) )
end end
@ -173,7 +173,7 @@ describe Hbc::Artifact::Uninstall do
) )
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%W[/sbin/kextunload -b #{kext_id}]) sudo(%W[/sbin/kextunload -b #{kext_id}]),
) )
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
@ -181,7 +181,7 @@ describe Hbc::Artifact::Uninstall do
) )
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(["/bin/rm", "-rf", "/Library/Extensions/FancyPackage.kext"]) sudo(["/bin/rm", "-rf", "/Library/Extensions/FancyPackage.kext"]),
) )
subject subject
@ -201,7 +201,7 @@ describe Hbc::Artifact::Uninstall do
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%w[/bin/launchctl list] %w[/bin/launchctl list],
) )
subject subject
@ -234,7 +234,7 @@ describe Hbc::Artifact::Uninstall do
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -rf --], sudo(%w[/bin/rm -rf --],
Pathname.new("/permissible/absolute/path"), Pathname.new("/permissible/absolute/path"),
Pathname.new("~/permissible/path/with/tilde").expand_path) Pathname.new("~/permissible/path/with/tilde").expand_path),
) )
subject subject
@ -248,7 +248,7 @@ describe Hbc::Artifact::Uninstall do
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -rf --], sudo(%w[/bin/rm -rf --],
Pathname.new("/permissible/absolute/path"), Pathname.new("/permissible/absolute/path"),
Pathname.new("~/permissible/path/with/tilde").expand_path) Pathname.new("~/permissible/path/with/tilde").expand_path),
) )
subject subject
@ -261,11 +261,11 @@ describe Hbc::Artifact::Uninstall do
it "can uninstall" do it "can uninstall" do
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -f --], dir_pathname.join(".DS_Store")) sudo(%w[/bin/rm -f --], dir_pathname.join(".DS_Store")),
) )
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rmdir --], dir_pathname) sudo(%w[/bin/rmdir --], dir_pathname),
) )
subject subject
@ -280,7 +280,7 @@ describe Hbc::Artifact::Uninstall do
Hbc::FakeSystemCommand.expects_command(%w[/bin/chmod -- +x] + [script_pathname]) Hbc::FakeSystemCommand.expects_command(%w[/bin/chmod -- +x] + [script_pathname])
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool"), "--please") sudo(cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool"), "--please"),
) )
subject subject
@ -295,7 +295,7 @@ describe Hbc::Artifact::Uninstall do
Hbc::FakeSystemCommand.expects_command(%w[/bin/chmod -- +x] + [script_pathname]) Hbc::FakeSystemCommand.expects_command(%w[/bin/chmod -- +x] + [script_pathname])
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool"), "--please") sudo(cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool"), "--please"),
) )
subject subject
@ -308,7 +308,7 @@ describe Hbc::Artifact::Uninstall do
it "can uninstall" do it "can uninstall" do
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["/usr/bin/osascript", "-e", 'tell application "System Events" to delete every login ' \ ["/usr/bin/osascript", "-e", 'tell application "System Events" to delete every login ' \
'item whose name is "Fancy"'] 'item whose name is "Fancy"'],
) )
subject subject

View File

@ -45,12 +45,12 @@ describe Hbc::Artifact::Zap do
it "can zap" do it "can zap" do
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
launchctl_list_cmd, launchctl_list_cmd,
service_info service_info,
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
sudo(launchctl_list_cmd), sudo(launchctl_list_cmd),
unknown_response unknown_response,
) )
Hbc::FakeSystemCommand.expects_command(launchctl_remove_cmd) Hbc::FakeSystemCommand.expects_command(launchctl_remove_cmd)
@ -63,12 +63,12 @@ describe Hbc::Artifact::Zap do
it "can zap" do it "can zap" do
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
launchctl_list_cmd, launchctl_list_cmd,
unknown_response unknown_response,
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
sudo(launchctl_list_cmd), sudo(launchctl_list_cmd),
service_info service_info,
) )
Hbc::FakeSystemCommand.expects_command(sudo(launchctl_remove_cmd)) Hbc::FakeSystemCommand.expects_command(sudo(launchctl_remove_cmd))
@ -126,7 +126,7 @@ describe Hbc::Artifact::Zap do
it "can zap" do it "can zap" do
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%w[/usr/sbin/pkgutil --pkgs=my.fancy.package.*], %w[/usr/sbin/pkgutil --pkgs=my.fancy.package.*],
"#{main_pkg_id}\n#{agent_pkg_id}" "#{main_pkg_id}\n#{agent_pkg_id}",
) )
[ [
@ -135,28 +135,28 @@ describe Hbc::Artifact::Zap do
].each do |pkg_id, pkg_files, pkg_dirs| ].each do |pkg_id, pkg_files, pkg_dirs|
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%W[/usr/sbin/pkgutil --only-files --files #{pkg_id}], %W[/usr/sbin/pkgutil --only-files --files #{pkg_id}],
pkg_files.join("\n") pkg_files.join("\n"),
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%W[/usr/sbin/pkgutil --only-dirs --files #{pkg_id}], %W[/usr/sbin/pkgutil --only-dirs --files #{pkg_id}],
pkg_dirs.join("\n") pkg_dirs.join("\n"),
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%W[/usr/sbin/pkgutil --files #{pkg_id}], %W[/usr/sbin/pkgutil --files #{pkg_id}],
(pkg_files + pkg_dirs).join("\n") (pkg_files + pkg_dirs).join("\n"),
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%W[/usr/sbin/pkgutil --pkg-info-plist #{pkg_id}], %W[/usr/sbin/pkgutil --pkg-info-plist #{pkg_id}],
pkg_info_plist pkg_info_plist,
) )
Hbc::FakeSystemCommand.expects_command(sudo(%W[/usr/sbin/pkgutil --forget #{pkg_id}])) Hbc::FakeSystemCommand.expects_command(sudo(%W[/usr/sbin/pkgutil --forget #{pkg_id}]))
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -f --] + pkg_files.map { |path| Pathname("/tmp/#{path}") }) sudo(%w[/bin/rm -f --] + pkg_files.map { |path| Pathname("/tmp/#{path}") }),
) )
end end
@ -174,7 +174,7 @@ describe Hbc::Artifact::Zap do
) )
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%W[/sbin/kextunload -b #{kext_id}]) sudo(%W[/sbin/kextunload -b #{kext_id}]),
) )
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
@ -182,7 +182,7 @@ describe Hbc::Artifact::Zap do
) )
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(["/bin/rm", "-rf", "/Library/Extensions/FancyPackage.kext"]) sudo(["/bin/rm", "-rf", "/Library/Extensions/FancyPackage.kext"]),
) )
subject subject
@ -202,7 +202,7 @@ describe Hbc::Artifact::Zap do
) )
Hbc::FakeSystemCommand.stubs_command( Hbc::FakeSystemCommand.stubs_command(
%w[/bin/launchctl list] %w[/bin/launchctl list],
) )
subject subject
@ -235,7 +235,7 @@ describe Hbc::Artifact::Zap do
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -rf --], sudo(%w[/bin/rm -rf --],
Pathname.new("/permissible/absolute/path"), Pathname.new("/permissible/absolute/path"),
Pathname.new("~/permissible/path/with/tilde").expand_path) Pathname.new("~/permissible/path/with/tilde").expand_path),
) )
subject subject
@ -249,7 +249,7 @@ describe Hbc::Artifact::Zap do
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -rf --], sudo(%w[/bin/rm -rf --],
Pathname.new("/permissible/absolute/path"), Pathname.new("/permissible/absolute/path"),
Pathname.new("~/permissible/path/with/tilde").expand_path) Pathname.new("~/permissible/path/with/tilde").expand_path),
) )
subject subject
@ -262,11 +262,11 @@ describe Hbc::Artifact::Zap do
it "can zap" do it "can zap" do
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rm -f --], dir_pathname.join(".DS_Store")) sudo(%w[/bin/rm -f --], dir_pathname.join(".DS_Store")),
) )
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(%w[/bin/rmdir --], dir_pathname) sudo(%w[/bin/rmdir --], dir_pathname),
) )
subject subject
@ -281,7 +281,7 @@ describe Hbc::Artifact::Zap do
Hbc::FakeSystemCommand.expects_command(%w[/bin/chmod -- +x] + [script_pathname]) Hbc::FakeSystemCommand.expects_command(%w[/bin/chmod -- +x] + [script_pathname])
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool"), "--please") sudo(cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool"), "--please"),
) )
subject subject
@ -296,7 +296,7 @@ describe Hbc::Artifact::Zap do
Hbc::FakeSystemCommand.expects_command(%w[/bin/chmod -- +x] + [script_pathname]) Hbc::FakeSystemCommand.expects_command(%w[/bin/chmod -- +x] + [script_pathname])
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
sudo(cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool"), "--please") sudo(cask.staged_path.join("MyFancyPkg", "FancyUninstaller.tool"), "--please"),
) )
subject subject
@ -309,7 +309,7 @@ describe Hbc::Artifact::Zap do
it "can zap" do it "can zap" do
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["/usr/bin/osascript", "-e", 'tell application "System Events" to delete every login ' \ ["/usr/bin/osascript", "-e", 'tell application "System Events" to delete every login ' \
'item whose name is "Fancy"'] 'item whose name is "Fancy"'],
) )
subject subject

View File

@ -8,7 +8,7 @@ describe Hbc::Container::Dmg do
dmg = Hbc::Container::Dmg.new( dmg = Hbc::Container::Dmg.new(
transmission, transmission,
Pathname(transmission.url.path), Pathname(transmission.url.path),
Hbc::SystemCommand Hbc::SystemCommand,
) )
begin begin

View File

@ -176,7 +176,7 @@ describe "download strategies" do
expect(downloader).to have_received(:fetch_repo).with( expect(downloader).to have_received(:fetch_repo).with(
downloader.cached_location, downloader.cached_location,
cask.url.to_s cask.url.to_s,
) )
end end
@ -196,7 +196,7 @@ describe "download strategies" do
"config:miscellany:use-commit-times=yes", "config:miscellany:use-commit-times=yes",
cask.url.to_s, cask.url.to_s,
downloader.cached_location, downloader.cached_location,
]) ]),
) )
end end
@ -226,7 +226,7 @@ describe "download strategies" do
"--non-interactive", "--non-interactive",
cask.url.to_s, cask.url.to_s,
downloader.cached_location, downloader.cached_location,
]) ]),
) )
end end
end end
@ -257,7 +257,7 @@ describe "download strategies" do
downloader.cached_location, downloader.cached_location,
"-r", "-r",
"10", "10",
]) ]),
) )
end end
end end
@ -283,7 +283,7 @@ describe "download strategies" do
downloader.tarball_path, downloader.tarball_path,
"--", "--",
".", ".",
]) ]),
) )
end end
end end

View File

@ -1,67 +1,67 @@
describe MacOS do describe MacOS do
it "says '/' is undeletable" do it "says '/' is undeletable" do
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"/" "/",
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"/." "/.",
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"/usr/local/Library/Taps/../../../.." "/usr/local/Library/Taps/../../../..",
) )
end end
it "says '/Applications' is undeletable" do it "says '/Applications' is undeletable" do
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"/Applications" "/Applications",
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"/Applications/" "/Applications/",
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"/Applications/." "/Applications/.",
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"/Applications/Mail.app/.." "/Applications/Mail.app/..",
) )
end end
it "says the home directory is undeletable" do it "says the home directory is undeletable" do
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
Dir.home Dir.home,
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"#{Dir.home}/" "#{Dir.home}/",
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"#{Dir.home}/Documents/.." "#{Dir.home}/Documents/..",
) )
end end
it "says the user library directory is undeletable" do it "says the user library directory is undeletable" do
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"#{Dir.home}/Library" "#{Dir.home}/Library",
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"#{Dir.home}/Library/" "#{Dir.home}/Library/",
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"#{Dir.home}/Library/." "#{Dir.home}/Library/.",
) )
expect(MacOS).to be_undeletable( expect(MacOS).to be_undeletable(
"#{Dir.home}/Library/Preferences/.." "#{Dir.home}/Library/Preferences/..",
) )
end end
it "says '/Applications/.app' is deletable" do it "says '/Applications/.app' is deletable" do
expect(MacOS).not_to be_undeletable( expect(MacOS).not_to be_undeletable(
"/Applications/.app" "/Applications/.app",
) )
end end
it "says '/Applications/SnakeOil Professional.app' is deletable" do it "says '/Applications/SnakeOil Professional.app' is deletable" do
expect(MacOS).not_to be_undeletable( expect(MacOS).not_to be_undeletable(
"/Applications/SnakeOil Professional.app" "/Applications/SnakeOil Professional.app",
) )
end end
end end

View File

@ -35,23 +35,23 @@ describe Hbc::Pkg do
it "forgets the pkg" do it "forgets the pkg" do
allow(fake_system_command).to receive(:run!).with( allow(fake_system_command).to receive(:run!).with(
"/usr/sbin/pkgutil", "/usr/sbin/pkgutil",
args: ["--only-files", "--files", "my.fake.pkg"] args: ["--only-files", "--files", "my.fake.pkg"],
).and_return(empty_response) ).and_return(empty_response)
allow(fake_system_command).to receive(:run!).with( allow(fake_system_command).to receive(:run!).with(
"/usr/sbin/pkgutil", "/usr/sbin/pkgutil",
args: ["--only-dirs", "--files", "my.fake.pkg"] args: ["--only-dirs", "--files", "my.fake.pkg"],
).and_return(empty_response) ).and_return(empty_response)
allow(fake_system_command).to receive(:run!).with( allow(fake_system_command).to receive(:run!).with(
"/usr/sbin/pkgutil", "/usr/sbin/pkgutil",
args: ["--files", "my.fake.pkg"] args: ["--files", "my.fake.pkg"],
).and_return(empty_response) ).and_return(empty_response)
expect(fake_system_command).to receive(:run!).with( expect(fake_system_command).to receive(:run!).with(
"/usr/sbin/pkgutil", "/usr/sbin/pkgutil",
args: ["--forget", "my.fake.pkg"], args: ["--forget", "my.fake.pkg"],
sudo: true sudo: true,
) )
pkg.uninstall pkg.uninstall

View File

@ -14,7 +14,7 @@ describe Hbc::Scopes do
%w[ %w[
loaded-cask-bar loaded-cask-bar
loaded-cask-foo loaded-cask-foo
] ],
) )
end end

View File

@ -36,7 +36,7 @@ describe Hbc::UrlChecker do
"Content-Type" => "application/x-apple-diskimage", "Content-Type" => "application/x-apple-diskimage",
"ETag" => '"b4208f3e84967be4b078ecaa03fba941"', "ETag" => '"b4208f3e84967be4b078ecaa03fba941"',
"Content-Length" => "23726161", "Content-Length" => "23726161",
"Last-Modified" => "Sun, 12 Aug 2012 21:17:21 GMT" "Last-Modified" => "Sun, 12 Aug 2012 21:17:21 GMT",
) )
end end
end end

View File

@ -21,7 +21,7 @@ describe Formatter do
"aa\n" \ "aa\n" \
"bbb\n" \ "bbb\n" \
"ccc\n" \ "ccc\n" \
"dd\n" "dd\n",
) )
end end
@ -32,7 +32,7 @@ describe Formatter do
expect(subject).to eq( expect(subject).to eq(
"aa ccc\n" \ "aa ccc\n" \
"bbb dd\n" "bbb dd\n",
) )
end end
@ -41,7 +41,7 @@ describe Formatter do
allow(Tty).to receive(:width).and_return(20) allow(Tty).to receive(:width).and_return(20)
expect(subject).to eq( expect(subject).to eq(
"aa bbb ccc dd\n" "aa bbb ccc dd\n",
) )
end end
end end

View File

@ -61,7 +61,7 @@ describe Plist do
/dev/disk3s1 /dev/disk3s1
/dev/disk3 /dev/disk3
/dev/disk3s2 /dev/disk3s2
] ],
) )
end end
end end

View File

@ -19,7 +19,7 @@ shared_examples Hbc::Staged do
it "can run system commands with list-form arguments" do it "can run system commands with list-form arguments" do
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["echo", "homebrew-cask", "rocks!"] ["echo", "homebrew-cask", "rocks!"],
) )
shutup do shutup do
@ -35,7 +35,7 @@ shared_examples Hbc::Staged do
allow(staged).to receive(:bundle_identifier).and_return("com.example.BasicCask") allow(staged).to receive(:bundle_identifier).and_return("com.example.BasicCask")
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["/usr/libexec/PlistBuddy", "-c", "Print CFBundleIdentifier", staged.info_plist_file] ["/usr/libexec/PlistBuddy", "-c", "Print CFBundleIdentifier", staged.info_plist_file],
) )
shutup do shutup do
@ -47,7 +47,7 @@ shared_examples Hbc::Staged do
allow(staged).to receive(:bundle_identifier).and_return("com.example.BasicCask") allow(staged).to receive(:bundle_identifier).and_return("com.example.BasicCask")
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", staged.info_plist_file] ["/usr/libexec/PlistBuddy", "-c", "Set :JVMOptions:JVMVersion 1.6+", staged.info_plist_file],
) )
shutup do shutup do
@ -60,7 +60,7 @@ shared_examples Hbc::Staged do
allow(staged).to receive(:Pathname).and_return(fake_pathname) allow(staged).to receive(:Pathname).and_return(fake_pathname)
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["/bin/chmod", "-R", "--", "777", fake_pathname] ["/bin/chmod", "-R", "--", "777", fake_pathname],
) )
shutup do shutup do
@ -73,7 +73,7 @@ shared_examples Hbc::Staged do
allow(staged).to receive(:Pathname).and_return(fake_pathname) allow(staged).to receive(:Pathname).and_return(fake_pathname)
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["/bin/chmod", "-R", "--", "777", fake_pathname, fake_pathname] ["/bin/chmod", "-R", "--", "777", fake_pathname, fake_pathname],
) )
shutup do shutup do
@ -94,7 +94,7 @@ shared_examples Hbc::Staged do
allow(staged).to receive(:Pathname).and_return(fake_pathname) allow(staged).to receive(:Pathname).and_return(fake_pathname)
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["/usr/bin/sudo", "-E", "--", "/usr/sbin/chown", "-R", "--", "fake_user:staff", fake_pathname] ["/usr/bin/sudo", "-E", "--", "/usr/sbin/chown", "-R", "--", "fake_user:staff", fake_pathname],
) )
shutup do shutup do
@ -109,7 +109,7 @@ shared_examples Hbc::Staged do
allow(staged).to receive(:Pathname).and_return(fake_pathname) allow(staged).to receive(:Pathname).and_return(fake_pathname)
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["/usr/bin/sudo", "-E", "--", "/usr/sbin/chown", "-R", "--", "fake_user:staff", fake_pathname, fake_pathname] ["/usr/bin/sudo", "-E", "--", "/usr/sbin/chown", "-R", "--", "fake_user:staff", fake_pathname, fake_pathname],
) )
shutup do shutup do
@ -123,7 +123,7 @@ shared_examples Hbc::Staged do
allow(staged).to receive(:Pathname).and_return(fake_pathname) allow(staged).to receive(:Pathname).and_return(fake_pathname)
Hbc::FakeSystemCommand.expects_command( Hbc::FakeSystemCommand.expects_command(
["/usr/bin/sudo", "-E", "--", "/usr/sbin/chown", "-R", "--", "other_user:other_group", fake_pathname] ["/usr/bin/sudo", "-E", "--", "/usr/sbin/chown", "-R", "--", "other_user:other_group", fake_pathname],
) )
shutup do shutup do

View File

@ -50,7 +50,7 @@ module Homebrew
tree?: ARGV.include?("--tree"), tree?: ARGV.include?("--tree"),
all?: ARGV.include?("--all"), all?: ARGV.include?("--all"),
topo_order?: ARGV.include?("-n"), topo_order?: ARGV.include?("-n"),
union?: ARGV.include?("--union") union?: ARGV.include?("--union"),
) )
if mode.installed? && mode.tree? if mode.installed? && mode.tree?

View File

@ -191,7 +191,7 @@ class FormulaAuditor
args = curl_args( args = curl_args(
extra_args: extra_args, extra_args: extra_args,
show_output: true, show_output: true,
user_agent: user_agent user_agent: user_agent,
) )
status_code = Open3.popen3(*args) { |_, stdout, _, _| stdout.read } status_code = Open3.popen3(*args) { |_, stdout, _, _| stdout.read }
break if status_code.start_with? "20" break if status_code.start_with? "20"

View File

@ -277,7 +277,7 @@ module Superenv
return unless Hardware::CPU.is_32_bit? return unless Hardware::CPU.is_32_bit?
self["HOMEBREW_OPTFLAGS"] = self["HOMEBREW_OPTFLAGS"].sub( self["HOMEBREW_OPTFLAGS"] = self["HOMEBREW_OPTFLAGS"].sub(
/-march=\S*/, /-march=\S*/,
"-Xarch_#{Hardware::CPU.arch_32_bit} \\0" "-Xarch_#{Hardware::CPU.arch_32_bit} \\0",
) )
end end

View File

@ -111,7 +111,7 @@ module Hardware
@features ||= sysctl_n( @features ||= sysctl_n(
"machdep.cpu.features", "machdep.cpu.features",
"machdep.cpu.extfeatures", "machdep.cpu.extfeatures",
"machdep.cpu.leaf7_features" "machdep.cpu.leaf7_features",
).split(" ").map { |s| s.downcase.to_sym } ).split(" ").map { |s| s.downcase.to_sym }
end end

View File

@ -431,7 +431,7 @@ class FormulaInstaller
inherited_options[dep.name] |= inherited_options_for(dep) inherited_options[dep.name] |= inherited_options_for(dep)
build = effective_build_options_for( build = effective_build_options_for(
dependent, dependent,
inherited_options.fetch(dependent.name, []) inherited_options.fetch(dependent.name, []),
) )
if (dep.optional? || dep.recommended?) && build.without?(dep) if (dep.optional? || dep.recommended?) && build.without?(dep)

View File

@ -34,7 +34,7 @@ class Keg
old_repository: HOMEBREW_REPOSITORY.to_s, old_repository: HOMEBREW_REPOSITORY.to_s,
new_prefix: PREFIX_PLACEHOLDER, new_prefix: PREFIX_PLACEHOLDER,
new_cellar: CELLAR_PLACEHOLDER, new_cellar: CELLAR_PLACEHOLDER,
new_repository: REPOSITORY_PLACEHOLDER new_repository: REPOSITORY_PLACEHOLDER,
) )
relocate_dynamic_linkage(relocation) relocate_dynamic_linkage(relocation)
replace_text_in_files(relocation) replace_text_in_files(relocation)
@ -47,7 +47,7 @@ class Keg
old_repository: REPOSITORY_PLACEHOLDER, old_repository: REPOSITORY_PLACEHOLDER,
new_prefix: HOMEBREW_PREFIX.to_s, new_prefix: HOMEBREW_PREFIX.to_s,
new_cellar: HOMEBREW_CELLAR.to_s, new_cellar: HOMEBREW_CELLAR.to_s,
new_repository: HOMEBREW_REPOSITORY.to_s new_repository: HOMEBREW_REPOSITORY.to_s,
) )
relocate_dynamic_linkage(relocation) unless skip_linkage relocate_dynamic_linkage(relocation) unless skip_linkage
replace_text_in_files(relocation, files: files) replace_text_in_files(relocation, files: files)
@ -71,7 +71,7 @@ class Keg
regexp = Regexp.union( regexp = Regexp.union(
relocation.old_cellar, relocation.old_cellar,
relocation.old_repository, relocation.old_repository,
relocation.old_prefix relocation.old_prefix,
) )
changed = s.gsub!(regexp, replacements) changed = s.gsub!(regexp, replacements)

View File

@ -93,7 +93,7 @@ class DependencyExpansionTests < Homebrew::TestCase
deps: [ deps: [
build_dep(:foo, [], [@bar, @baz]), build_dep(:foo, [], [@bar, @baz]),
build_dep(:foo, [], [@baz]), build_dep(:foo, [], [@baz]),
] ],
) )
deps = Dependency.expand(f) do |_dependent, dep| deps = Dependency.expand(f) do |_dependent, dep|

View File

@ -209,12 +209,12 @@ class FormulaTests < Homebrew::TestCase
refute_predicate f, :installed? refute_predicate f, :installed?
f.stubs(:installed_prefix).returns( f.stubs(:installed_prefix).returns(
stub(directory?: true, children: []) stub(directory?: true, children: []),
) )
refute_predicate f, :installed? refute_predicate f, :installed?
f.stubs(:installed_prefix).returns( f.stubs(:installed_prefix).returns(
stub(directory?: true, children: [stub]) stub(directory?: true, children: [stub]),
) )
assert_predicate f, :installed? assert_predicate f, :installed?
end end

View File

@ -17,7 +17,7 @@ class LanguagePythonTests < Homebrew::TestCase
def test_virtualenv_creation def test_virtualenv_creation
@formula.expects(:resource).with("homebrew-virtualenv").returns( @formula.expects(:resource).with("homebrew-virtualenv").returns(
mock("resource", stage: true) mock("resource", stage: true),
) )
@venv.create @venv.create
end end
@ -25,7 +25,7 @@ class LanguagePythonTests < Homebrew::TestCase
# or at least doesn't crash the second time # or at least doesn't crash the second time
def test_virtualenv_creation_is_idempotent def test_virtualenv_creation_is_idempotent
@formula.expects(:resource).with("homebrew-virtualenv").returns( @formula.expects(:resource).with("homebrew-virtualenv").returns(
mock("resource", stage: true) mock("resource", stage: true),
) )
@venv.create @venv.create
FileUtils.mkdir_p @dir/"bin" FileUtils.mkdir_p @dir/"bin"

View File

@ -48,7 +48,7 @@ class LegacyPatchTests < Homebrew::TestCase
def test_patch_array def test_patch_array
patches = Patch.normalize_legacy_patches( patches = Patch.normalize_legacy_patches(
%w[http://example.com/patch1.diff http://example.com/patch2.diff] %w[http://example.com/patch1.diff http://example.com/patch2.diff],
) )
assert_equal 2, patches.length assert_equal 2, patches.length
@ -58,7 +58,7 @@ class LegacyPatchTests < Homebrew::TestCase
def test_p0_hash_to_string def test_p0_hash_to_string
patches = Patch.normalize_legacy_patches( patches = Patch.normalize_legacy_patches(
p0: "http://example.com/patch.diff" p0: "http://example.com/patch.diff",
) )
assert_equal 1, patches.length assert_equal 1, patches.length
@ -67,7 +67,7 @@ class LegacyPatchTests < Homebrew::TestCase
def test_p1_hash_to_string def test_p1_hash_to_string
patches = Patch.normalize_legacy_patches( patches = Patch.normalize_legacy_patches(
p1: "http://example.com/patch.diff" p1: "http://example.com/patch.diff",
) )
assert_equal 1, patches.length assert_equal 1, patches.length
@ -77,7 +77,7 @@ class LegacyPatchTests < Homebrew::TestCase
def test_mixed_hash_to_strings def test_mixed_hash_to_strings
patches = Patch.normalize_legacy_patches( patches = Patch.normalize_legacy_patches(
p1: "http://example.com/patch1.diff", p1: "http://example.com/patch1.diff",
p0: "http://example.com/patch0.diff" p0: "http://example.com/patch0.diff",
) )
assert_equal 2, patches.length assert_equal 2, patches.length
assert_equal 1, patches.count { |p| p.strip == :p0 } assert_equal 1, patches.count { |p| p.strip == :p0 }
@ -89,7 +89,7 @@ class LegacyPatchTests < Homebrew::TestCase
p1: ["http://example.com/patch10.diff", p1: ["http://example.com/patch10.diff",
"http://example.com/patch11.diff"], "http://example.com/patch11.diff"],
p0: ["http://example.com/patch00.diff", p0: ["http://example.com/patch00.diff",
"http://example.com/patch01.diff"] "http://example.com/patch01.diff"],
) )
assert_equal 4, patches.length assert_equal 4, patches.length

View File

@ -42,7 +42,7 @@ class ShellSmokeTest < Homebrew::TestCase
prepend_message = Utils::Shell.prepend_path_in_shell_profile(path) prepend_message = Utils::Shell.prepend_path_in_shell_profile(path)
assert( assert(
prepend_message.start_with?(fragment), prepend_message.start_with?(fragment),
"#{shell}: expected #{prepend_message} to match #{fragment}" "#{shell}: expected #{prepend_message} to match #{fragment}",
) )
end end

View File

@ -35,7 +35,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase
"HOMEBREW_BREW_FILE" => HOMEBREW_PREFIX/"bin/brew", "HOMEBREW_BREW_FILE" => HOMEBREW_PREFIX/"bin/brew",
"HOMEBREW_INTEGRATION_TEST" => cmd_id_from_args(args), "HOMEBREW_INTEGRATION_TEST" => cmd_id_from_args(args),
"HOMEBREW_TEST_TMPDIR" => TEST_TMPDIR, "HOMEBREW_TEST_TMPDIR" => TEST_TMPDIR,
"HOMEBREW_DEVELOPER" => ENV["HOMEBREW_DEVELOPER"] "HOMEBREW_DEVELOPER" => ENV["HOMEBREW_DEVELOPER"],
) )
ruby_args = [ ruby_args = [

View File

@ -32,7 +32,7 @@ class TabTests < Homebrew::TestCase
"devel" => "0.14", "devel" => "0.14",
"head" => "HEAD-1111111", "head" => "HEAD-1111111",
}, },
} },
) )
end end

View File

@ -164,7 +164,7 @@ class Version
RCToken::PATTERN, RCToken::PATTERN,
PatchToken::PATTERN, PatchToken::PATTERN,
NumericToken::PATTERN, NumericToken::PATTERN,
StringToken::PATTERN StringToken::PATTERN,
) )
class FromURL < Version class FromURL < Version