File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,9 @@ def file_collision(destination)
252252 )
253253
254254 case answer
255+ when nil
256+ say ""
257+ return true
255258 when is? ( :yes ) , is? ( :force ) , ""
256259 return true
257260 when is? ( :no ) , is? ( :skip )
Original file line number Diff line number Diff line change @@ -310,6 +310,12 @@ def #456 Lanç...
310310 shell . file_collision ( "foo" )
311311 end
312312
313+ it "outputs a new line and returns true if stdin is closed" do
314+ expect ( $stdout) . to receive ( :print ) . with ( "\n " )
315+ expect ( Thor ::LineEditor ) . to receive ( :readline ) . and_return ( nil )
316+ expect ( shell . file_collision ( "foo" ) ) . to be true
317+ end
318+
313319 it "returns true if the user chooses default option" do
314320 expect ( Thor ::LineEditor ) . to receive ( :readline ) . and_return ( "" )
315321 expect ( shell . file_collision ( "foo" ) ) . to be true
You can’t perform that action at this time.
0 commit comments