Use ArgumentError instead of CaskError in CLI.
				
					
				
			This commit is contained in:
		
							parent
							
								
									1959cc3f2d
								
							
						
					
					
						commit
						536a377d71
					
				@ -228,9 +228,9 @@ module Hbc
 | 
				
			|||||||
          remaining << head
 | 
					          remaining << head
 | 
				
			||||||
          retry
 | 
					          retry
 | 
				
			||||||
        rescue OptionParser::MissingArgument
 | 
					        rescue OptionParser::MissingArgument
 | 
				
			||||||
          raise CaskError, "The option '#{head}' requires an argument"
 | 
					          raise ArgumentError, "The option '#{head}' requires an argument."
 | 
				
			||||||
        rescue OptionParser::AmbiguousOption
 | 
					        rescue OptionParser::AmbiguousOption
 | 
				
			||||||
          raise CaskError, "There is more than one possible option that starts with '#{head}'"
 | 
					          raise ArgumentError, "There is more than one possible option that starts with '#{head}'."
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -108,7 +108,7 @@ describe Hbc::CLI, :cask do
 | 
				
			|||||||
    it "shows a user-friendly error message" do
 | 
					    it "shows a user-friendly error message" do
 | 
				
			||||||
      expect {
 | 
					      expect {
 | 
				
			||||||
        Hbc::CLI.process_options %w[install -f]
 | 
					        Hbc::CLI.process_options %w[install -f]
 | 
				
			||||||
      }.to raise_error(Hbc::CaskError)
 | 
					      }.to raise_error(ArgumentError)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -116,7 +116,7 @@ describe Hbc::CLI, :cask do
 | 
				
			|||||||
    it "shows a user-friendly error message" do
 | 
					    it "shows a user-friendly error message" do
 | 
				
			||||||
      expect {
 | 
					      expect {
 | 
				
			||||||
        Hbc::CLI.process_options %w[edit -c]
 | 
					        Hbc::CLI.process_options %w[edit -c]
 | 
				
			||||||
      }.to raise_error(Hbc::CaskError)
 | 
					      }.to raise_error(ArgumentError)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user