File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ def install(content)
5454 installer = Installer . from_string program : args [ '--install' ] , string : content
5555 success = installer . install force : true
5656 raise InstallError , "Failed running command:\n nb`#{ installer . install_command_string } `" unless success
57+
5758 say "Saved m`#{ installer . target_path } `"
5859 say 'You may need to restart your session to test it'
5960 end
Original file line number Diff line number Diff line change 1+ Saved stubbed target_path
2+ You may need to restart your session to test it
Original file line number Diff line number Diff line change 116116 end
117117 end
118118
119- context 'with --wrapper NAME' do
119+ context 'with --install PROGRAM' do
120+ let ( :mock_installer ) do
121+ instance_double Installer ,
122+ install : true ,
123+ install_command_string : 'stubbed install_command_string' ,
124+ target_path : 'stubbed target_path'
125+ end
126+
127+ it 'passes the generated script to the installer' do
128+ allow ( Installer ) . to receive ( :from_string )
129+ . with (
130+ program : 'mycli' ,
131+ string : a_string_matching ( /bash completions script/ )
132+ ) . and_return ( mock_installer )
133+
134+ expect ( mock_installer ) . to receive ( :install )
135+
136+ expect { subject . execute %w[ generate --install mycli ] } . to output_approval ( 'cli/generate/install' )
137+ end
138+ end
139+
140+ context 'with --wrap NAME' do
120141 after { system 'rm -f completely.bash' }
121142
122143 it 'wraps the script in a function' do
You can’t perform that action at this time.
0 commit comments