File tree Expand file tree Collapse file tree 4 files changed +40
-2
lines changed Expand file tree Collapse file tree 4 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- code_ownership (1.25 .0 )
4+ code_ownership (1.26 .0 )
55 bigrails-teams
66 parse_packwerk
77 sorbet-runtime
Original file line number Diff line number Diff line change 11Gem ::Specification . new do |spec |
22 spec . name = "code_ownership"
3- spec . version = '1.25 .0'
3+ spec . version = '1.26 .0'
44 spec . authors = [ 'Gusto Engineers' ]
55 spec . email = [ '[email protected] ' ] 66 spec . summary = 'A gem to help engineering teams declare ownership of code'
Original file line number Diff line number Diff line change @@ -11,7 +11,19 @@ def self.run!(argv)
1111 validate! ( argv )
1212 elsif command == 'for_file'
1313 for_file ( argv )
14+ elsif [ nil , "help" ] . include? ( command )
15+ puts <<~USAGE
16+ Usage: bin/codeownership <subcommand>
17+
18+ Subcommands:
19+ validate - run all validations
20+ for_file - find code ownership for a single file
21+ help - display help information about code_ownership
22+ USAGE
23+ else
24+ puts "'#{ command } ' is not a code_ownership command. See `bin/codeownership help`."
1425 end
26+
1527 end
1628
1729 def self . validate! ( argv )
Original file line number Diff line number Diff line change 103103 end
104104 end
105105 end
106+
107+ describe 'using unknown command' do
108+ let ( :argv ) { [ 'some_command' ] }
109+
110+ it 'outputs help text' do
111+ expect ( CodeOwnership ::Cli ) . to receive ( :puts ) . with ( "'some_command' is not a code_ownership command. See `bin/codeownership help`." )
112+ subject
113+ end
114+ end
115+
116+ describe 'passing in no command' do
117+ let ( :argv ) { [ ] }
118+
119+ it 'outputs help text' do
120+ expected = <<~EXPECTED
121+ Usage: bin/codeownership <subcommand>
122+
123+ Subcommands:
124+ validate - run all validations
125+ for_file - find code ownership for a single file
126+ help - display help information about code_ownership
127+ EXPECTED
128+ expect ( CodeOwnership ::Cli ) . to receive ( :puts ) . with ( expected )
129+ subject
130+ end
131+ end
106132end
You can’t perform that action at this time.
0 commit comments