Merge pull request #2350 from reitermarkus/test-help-strings
Add test for command help strings.
This commit is contained in:
		
						commit
						6c180e5008
					
				@ -14,7 +14,7 @@ module Hbc
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      def self.help
 | 
			
		||||
        "No help available for the #{command_name} command"
 | 
			
		||||
        nil
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      def self.needs_init?
 | 
			
		||||
 | 
			
		||||
@ -23,6 +23,10 @@ module Hbc
 | 
			
		||||
        args.reject { |a| a.empty? || a.chars.first == "-" }
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      def self.help
 | 
			
		||||
        "audit all modified Casks in a given commit range"
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      def self.usage
 | 
			
		||||
        <<-EOS.undent
 | 
			
		||||
          Usage: brew cask _audit_modified_casks [options...] <commit range>
 | 
			
		||||
 | 
			
		||||
@ -63,4 +63,10 @@ describe Hbc::CLI, :cask do
 | 
			
		||||
      described_class.process("noop")
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it "provides a help message for all commands" do
 | 
			
		||||
    described_class.command_classes.each do |command_class|
 | 
			
		||||
      expect(command_class.help).to match(/\w+/), command_class.name
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user