| 
									
										
										
										
											2017-02-23 06:01:13 +01:00
										 |  |  | describe "brew pull", :integration_test do | 
					
						
							| 
									
										
										
										
											2018-09-14 16:56:23 +02:00
										 |  |  |   it "fetches a patch from a GitHub commit or pull request and applies it", :needs_network do | 
					
						
							| 
									
										
										
										
											2017-02-23 06:01:13 +01:00
										 |  |  |     CoreTap.instance.path.cd do | 
					
						
							| 
									
										
										
										
											2017-07-29 19:55:05 +02:00
										 |  |  |       system "git", "init" | 
					
						
							|  |  |  |       system "git", "checkout", "-b", "new-branch" | 
					
						
							| 
									
										
										
										
											2017-02-23 06:01:13 +01:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-30 19:14:40 +01:00
										 |  |  |     expect { brew "pull", "https://jenkins.brew.sh/job/Homebrew\%20Testing/1028/" } | 
					
						
							| 
									
										
										
										
											2017-02-23 06:01:13 +01:00
										 |  |  |       .to output(/Testing URLs require `\-\-bottle`!/).to_stderr | 
					
						
							|  |  |  |       .and not_to_output.to_stdout | 
					
						
							|  |  |  |       .and be_a_failure | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-25 17:21:09 +00:00
										 |  |  |     # Needs Homebrew/homebrew-core | 
					
						
							|  |  |  |     if OS.mac? | 
					
						
							|  |  |  |       expect { brew "pull", "1" } | 
					
						
							|  |  |  |         .to output(/Fetching patch/).to_stdout | 
					
						
							|  |  |  |         .and output(/Current branch is new\-branch/).to_stderr | 
					
						
							|  |  |  |         .and be_a_failure | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2017-02-23 06:01:13 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     expect { brew "pull", "--bump", "https://api.github.com/repos/Homebrew/homebrew-core/pulls/122" } | 
					
						
							|  |  |  |       .to output(/Fetching patch/).to_stdout | 
					
						
							|  |  |  |       .and output(/Can only bump one changed formula/).to_stderr | 
					
						
							|  |  |  |       .and be_a_failure | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-04 15:41:50 -04:00
										 |  |  |     expect { brew "pull", "https://github.com/Homebrew/brew/pull/1249" } | 
					
						
							| 
									
										
										
										
											2017-02-23 06:01:13 +01:00
										 |  |  |       .to output(/Fetching patch/).to_stdout | 
					
						
							|  |  |  |       .and output(/Patch failed to apply/).to_stderr | 
					
						
							|  |  |  |       .and be_a_failure | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |