| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  | describe "brew bottle", :integration_test do | 
					
						
							|  |  |  |   it "builds a bottle for the given Formula" do | 
					
						
							|  |  |  |     begin | 
					
						
							| 
									
										
										
										
											2017-07-29 19:55:05 +02:00
										 |  |  |       expect { brew "install", "--build-bottle", testball } | 
					
						
							|  |  |  |         .to be_a_success | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-22 16:56:37 -07:00
										 |  |  |       setup_test_formula "patchelf" | 
					
						
							|  |  |  |       (HOMEBREW_CELLAR/"patchelf/1.0/bin").mkpath | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  |       expect { brew "bottle", "--no-rebuild", testball } | 
					
						
							| 
									
										
										
										
											2018-10-08 22:49:03 -04:00
										 |  |  |         .to output(/Formula not from core or any installed taps/).to_stderr | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  |         .and not_to_output.to_stdout | 
					
						
							|  |  |  |         .and be_a_failure | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-29 14:33:25 -07:00
										 |  |  |       expect { brew "bottle", "--root-url" } | 
					
						
							|  |  |  |         .to output(/missing argument: --root-url/).to_stderr | 
					
						
							|  |  |  |         .and not_to_output.to_stdout | 
					
						
							|  |  |  |         .and be_a_failure | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  |       setup_test_formula "testball" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       # `brew bottle` should not fail with dead symlink | 
					
						
							|  |  |  |       # https://github.com/Homebrew/legacy-homebrew/issues/49007 | 
					
						
							|  |  |  |       (HOMEBREW_CELLAR/"testball/0.1").cd do | 
					
						
							|  |  |  |         FileUtils.ln_s "not-exist", "symlink" | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       expect { brew "bottle", "--no-rebuild", "testball" } | 
					
						
							| 
									
										
										
										
											2018-08-06 15:02:52 +02:00
										 |  |  |         .to output(/testball--0\.1.*\.bottle\.tar\.gz/).to_stdout | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  |         .and not_to_output.to_stderr | 
					
						
							|  |  |  |         .and be_a_success | 
					
						
							|  |  |  |     ensure | 
					
						
							| 
									
										
										
										
											2018-08-06 15:02:52 +02:00
										 |  |  |       FileUtils.rm_f Dir.glob("testball--0.1*.bottle.tar.gz") | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |