From 78f8c60343b514ee7129cf3c86f216460a4ed3ab Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Fri, 27 May 2016 23:12:26 +0200 Subject: [PATCH] tests: fix external command test and code style (#281) The check that `t4` is not an external command would always succeed, but not because the file wasn't executable, but because it wasn't even found due to the missing `brew-` prefix. Also change the valid but atypical file mode from 0744 to 0755 and apply minor code style fixes. --- Library/Homebrew/test/test_commands.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/test/test_commands.rb b/Library/Homebrew/test/test_commands.rb index 78a5d1c287..b6dd5c2be9 100644 --- a/Library/Homebrew/test/test_commands.rb +++ b/Library/Homebrew/test/test_commands.rb @@ -19,7 +19,7 @@ class CommandsTests < Homebrew::TestCase end def teardown - @cmds.each { |f| f.unlink } + @cmds.each(&:unlink) end def test_internal_commands @@ -43,12 +43,12 @@ class CommandsTests < Homebrew::TestCase %w[brew-t1 brew-t2.rb brew-t3.py].each do |file| path = "#{dir}/#{file}" FileUtils.touch path - FileUtils.chmod 0744, path + FileUtils.chmod 0755, path end - FileUtils.touch "#{dir}/t4" + FileUtils.touch "#{dir}/brew-t4" - ENV["PATH"] = "#{ENV["PATH"]}#{File::PATH_SEPARATOR}#{dir}" + ENV["PATH"] += "#{File::PATH_SEPARATOR}#{dir}" cmds = Homebrew.external_commands assert cmds.include?("t1"), "Executable files should be included"