aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-01-14 14:13:10 +0000
committerMike McQuaid2016-01-17 19:48:02 +0000
commit04a9b0022d42fea55f3435e461008525a7199a61 (patch)
treee611e522cd161d6cf4e29f96604e8fcce5949ea9 /Library
parent99234f0256110b23e915f7a8f029e5e25c54362e (diff)
downloadbrew-04a9b0022d42fea55f3435e461008525a7199a61.tar.bz2
test_bash: tests to assert Bash syntax is valid.
Closes Homebrew/homebrew#47380.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_bash.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_bash.rb b/Library/Homebrew/test/test_bash.rb
new file mode 100644
index 000000000..b77927e0b
--- /dev/null
+++ b/Library/Homebrew/test/test_bash.rb
@@ -0,0 +1,16 @@
+require "testing_env"
+
+class BashTests < Homebrew::TestCase
+ def assert_valid_bash_syntax(files)
+ output = Utils.popen_read("/bin/bash -n #{files} 2>&1")
+ assert $?.success?, output
+ end
+
+ def test_bin_brew
+ assert_valid_bash_syntax "#{HOMEBREW_LIBRARY_PATH.parent.parent}/bin/brew"
+ end
+
+ def test_bash_cmds
+ assert_valid_bash_syntax "#{HOMEBREW_LIBRARY_PATH}/cmd/*.sh"
+ end
+end