| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-27 11:49:56 +00:00
										 |  |  | shared_examples "parseable arguments" do | 
					
						
							|  |  |  |   subject(:method_name) do |example| | 
					
						
							|  |  |  |     example.metadata[:example_group][:parent_example_group][:description] | 
					
						
							| 
									
										
										
										
											2020-05-22 08:52:26 +01:00
										 |  |  |            .delete_prefix("Homebrew.") | 
					
						
							| 
									
										
										
										
											2019-03-27 11:49:56 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   let(:command_name) do | 
					
						
							| 
									
										
										
										
											2020-05-22 08:52:26 +01:00
										 |  |  |     method_name.delete_suffix("_args") | 
					
						
							|  |  |  |                .tr("_", "-") | 
					
						
							| 
									
										
										
										
											2019-03-27 11:49:56 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it "can parse arguments" do | 
					
						
							|  |  |  |     require "dev-cmd/#{command_name}" unless require? "cmd/#{command_name}" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-04 17:27:25 +00:00
										 |  |  |     expect { Homebrew.send(method_name).parse({}, allow_no_named_args: true) } | 
					
						
							| 
									
										
										
										
											2019-03-27 11:49:56 +00:00
										 |  |  |       .not_to raise_error | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |