| 
									
										
										
										
											2020-10-10 14:16:11 +02:00
										 |  |  | # typed: false | 
					
						
							| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-27 11:49:56 +00:00
										 |  |  | require "cmd/shared_examples/args_parse" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | describe "Homebrew.bottle_args" do | 
					
						
							|  |  |  |   it_behaves_like "parseable arguments" | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  | describe "brew bottle", :integration_test do | 
					
						
							|  |  |  |   it "builds a bottle for the given Formula" do | 
					
						
							| 
									
										
										
										
											2019-03-27 09:45:48 +00:00
										 |  |  |     # create stub patchelf | 
					
						
							|  |  |  |     if OS.linux? | 
					
						
							| 
									
										
										
										
											2018-06-22 16:56:37 -07:00
										 |  |  |       setup_test_formula "patchelf" | 
					
						
							| 
									
										
										
										
											2019-03-27 09:45:48 +00:00
										 |  |  |       patchelf = HOMEBREW_CELLAR/"patchelf/1.0/bin/patchelf" | 
					
						
							|  |  |  |       patchelf.dirname.mkpath | 
					
						
							|  |  |  |       patchelf.write <<~EOS | 
					
						
							|  |  |  |         #!/bin/sh | 
					
						
							|  |  |  |         exit 0
 | 
					
						
							|  |  |  |       EOS | 
					
						
							|  |  |  |       FileUtils.chmod "+x", patchelf | 
					
						
							|  |  |  |       FileUtils.ln_s patchelf, HOMEBREW_PREFIX/"bin/patchelf" | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-27 09:45:48 +00:00
										 |  |  |     install_test_formula "testball", build_bottle: true | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-27 09:45:48 +00:00
										 |  |  |     # `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" | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  |     end | 
					
						
							| 
									
										
										
										
											2019-03-27 09:45:48 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-27 11:49:56 +00:00
										 |  |  |     begin | 
					
						
							|  |  |  |       expect { brew "bottle", "--no-rebuild", "testball" } | 
					
						
							|  |  |  |         .to output(/testball--0\.1.*\.bottle\.tar\.gz/).to_stdout | 
					
						
							|  |  |  |         .and not_to_output.to_stderr | 
					
						
							|  |  |  |         .and be_a_success | 
					
						
							|  |  |  |     ensure | 
					
						
							|  |  |  |       FileUtils.rm_f Dir.glob("testball--0.1*.bottle.tar.gz") | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2017-02-23 05:58:30 +01:00
										 |  |  |   end | 
					
						
							|  |  |  | end |