| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-18 15:11:11 -08:00
										 |  |  | RSpec.describe "brew", :integration_test do | 
					
						
							| 
									
										
										
										
											2017-02-23 06:05:26 +01:00
										 |  |  |   describe "help" do | 
					
						
							|  |  |  |     it "prints help for a documented Ruby command" do | 
					
						
							|  |  |  |       expect { brew "help", "cat" } | 
					
						
							| 
									
										
										
										
											2019-01-18 22:17:46 +05:30
										 |  |  |         .to output(/^Usage: brew cat/).to_stdout | 
					
						
							| 
									
										
										
										
											2020-11-29 18:38:05 +01:00
										 |  |  |         .and not_to_output.to_stderr | 
					
						
							| 
									
										
										
										
											2017-02-23 06:05:26 +01:00
										 |  |  |         .and be_a_success | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   describe "cat" do | 
					
						
							|  |  |  |     it "prints help when no argument is given" do | 
					
						
							|  |  |  |       expect { brew "cat" } | 
					
						
							| 
									
										
										
										
											2019-01-18 22:17:46 +05:30
										 |  |  |         .to output(/^Usage: brew cat/).to_stderr | 
					
						
							| 
									
										
										
										
											2020-11-29 17:57:10 +01:00
										 |  |  |         .and not_to_output.to_stdout | 
					
						
							| 
									
										
										
										
											2017-02-23 06:05:26 +01:00
										 |  |  |         .and be_a_failure | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |