| 
									
										
										
										
											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" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-01 16:14:25 -05:00
										 |  |  | describe "brew create" do | 
					
						
							| 
									
										
										
										
											2017-02-23 06:00:46 +01:00
										 |  |  |   let(:url) { "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" } | 
					
						
							|  |  |  |   let(:formula_file) { CoreTap.new.formula_dir/"testball.rb" } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-01 16:14:25 -05:00
										 |  |  |   it_behaves_like "parseable arguments" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it "creates a new Formula file for a given URL", :integration_test do | 
					
						
							| 
									
										
										
										
											2022-12-05 16:07:11 -05:00
										 |  |  |     brew "create", "--set-name=Testball", url, "HOMEBREW_EDITOR" => "/bin/cat" | 
					
						
							| 
									
										
										
										
											2017-02-23 06:00:46 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     expect(formula_file).to exist | 
					
						
							|  |  |  |     expect(formula_file.read).to match(%Q(sha256 "#{TESTBALL_SHA256}")) | 
					
						
							|  |  |  |   end | 
					
						
							| 
									
										
										
										
											2021-04-12 16:06:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |   it "generates valid cask tokens" do | 
					
						
							|  |  |  |     t = Cask::Utils.token_from("A Foo@Bar_Baz++!") | 
					
						
							|  |  |  |     expect(t).to eq("a-foo-at-bar-baz-plus-plus") | 
					
						
							|  |  |  |   end | 
					
						
							| 
									
										
										
										
											2017-02-23 06:00:46 +01:00
										 |  |  | end |