diff options
| author | Martin Afanasjew | 2016-05-27 23:12:26 +0200 |
|---|---|---|
| committer | Martin Afanasjew | 2016-05-27 23:12:26 +0200 |
| commit | 78f8c60343b514ee7129cf3c86f216460a4ed3ab (patch) | |
| tree | 2dc71541e9ed94e3f4dec6f07a6939f86bbb730e /Library | |
| parent | aa747b915a080633e626cd741fa8f74ae6c5c9d8 (diff) | |
| download | brew-78f8c60343b514ee7129cf3c86f216460a4ed3ab.tar.bz2 | |
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.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/test/test_commands.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/test/test_commands.rb b/Library/Homebrew/test/test_commands.rb index 78a5d1c28..b6dd5c2be 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" |
