| 
									
										
										
										
											2016-01-14 14:13:10 +00:00
										 |  |  | 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 | 
					
						
							| 
									
										
										
										
											2016-01-21 18:43:48 +01:00
										 |  |  |     %w[cmd dev-cmd].each do |dir| | 
					
						
							|  |  |  |       Dir["#{HOMEBREW_LIBRARY_PATH}/#{dir}/*.sh"].each do |cmd| | 
					
						
							|  |  |  |         assert_valid_bash_syntax cmd | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2016-01-14 14:13:10 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | end |