1111
1212 after { keys_file . unlink }
1313
14- def cli ( argv )
15- described_class . new ( argv ) . tap do |cli |
14+ def cli
15+ described_class . new . tap do |cli |
1616 cli . stub (
1717 github_hostname : hostname ,
1818 keys_file_path : keys_file . path
@@ -21,41 +21,41 @@ def cli(argv)
2121 end
2222
2323 it 'adds and removes keys from the keys file' do
24- cli ( %w( add chrishunt ) ) . execute
24+ cli . execute %w( -- add chrishunt )
2525
2626 keys_file . read . tap do |keys_file_content |
2727 keys . each { |key | expect ( keys_file_content ) . to include key . to_s }
2828 end
2929
30- cli ( %w( remove chrishunt ) ) . execute
30+ cli . execute %w( -- remove chrishunt )
3131
3232 expect ( keys_file . read ) . to be_empty
3333
3434 keys_file . unlink
3535 end
3636
3737 it 'lists users from the keys file' do
38- cli ( %w( add chrishunt ) ) . execute
38+ cli . execute %w( -- add chrishunt )
3939
4040 output = capture_stdout do
41- cli ( %w( list ) ) . execute
41+ cli . execute %w( -- list)
4242 end
4343
4444 expect ( output ) . to include ( 'chrishunt' )
4545 end
4646
4747 it 'prints version information' do
4848 output = capture_stdout do
49- cli ( %w( --version ) ) . execute
49+ cli . execute %w( --version )
5050 end
5151
5252 expect ( output ) . to include Github ::Auth ::VERSION
5353 end
5454
5555 it 'prints usage for invalid arguments' do
56- [ [ ] , %w( invalid ) , %w( add ) ] . each do |invalid_arguments |
56+ [ [ ] , %w( invalid ) , %w( -- add) ] . each do |invalid_arguments |
5757 expect (
58- capture_stdout { cli ( invalid_arguments ) . execute }
58+ capture_stdout { cli . execute invalid_arguments }
5959 ) . to include 'usage: gh-auth'
6060 end
6161 end
0 commit comments