File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 339339 end
340340 end
341341
342+ describe '#public_commands' do
343+ let ( :fixture ) { :private_commands }
344+
345+ it 'returns an array of Command objects excluding private commands' do
346+ expect ( subject . public_commands . count ) . to eq 1
347+ expect ( subject . public_commands . first . name ) . to eq 'connect'
348+ end
349+ end
350+
351+ describe '#public_commands_aliases' do
352+ let ( :fixture ) { :private_commands }
353+
354+ it 'returns an array of command aliases of public subcommands' do
355+ expect ( subject . public_command_aliases ) . to eq %w[ connect c ]
356+ end
357+ end
358+
342359 describe '#user_file_path' do
343360 it 'returns the path to the user file' do
344361 expect ( subject . user_file_path 'test.sh' ) . to eq 'spec/tmp/src/test.sh'
Original file line number Diff line number Diff line change 378378 short : -c
379379 allowed : [green, red]
380380
381+ :private_commands :
382+ name : private
383+ help : Test private commands
384+ commands :
385+ - name : connect
386+ alias : c
387+ - name : connect-ftp
388+ alias : cf
389+ private : true
390+ - name : connect-ssh
391+ alias : cf
392+ private : true
393+
381394:repeatable_arg :
382395 name : get
383396 args :
You can’t perform that action at this time.
0 commit comments