File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed
Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,12 @@ import (
1818
1919func Test_NewCmdRefresh (t * testing.T ) {
2020 tests := []struct {
21- name string
22- cli string
23- wants RefreshOptions
24- wantsErr bool
25- tty bool
21+ name string
22+ cli string
23+ wants RefreshOptions
24+ wantsErr bool
25+ tty bool
26+ neverPrompt bool
2627 }{
2728 {
2829 name : "tty no arguments" ,
@@ -48,6 +49,22 @@ func Test_NewCmdRefresh(t *testing.T) {
4849 Hostname : "aline.cedrac" ,
4950 },
5051 },
52+ {
53+ name : "prompts disabled, no args" ,
54+ tty : true ,
55+ cli : "" ,
56+ neverPrompt : true ,
57+ wantsErr : true ,
58+ },
59+ {
60+ name : "prompts disabled, hostname" ,
61+ tty : true ,
62+ cli : "-h aline.cedrac" ,
63+ neverPrompt : true ,
64+ wants : RefreshOptions {
65+ Hostname : "aline.cedrac" ,
66+ },
67+ },
5168 {
5269 name : "tty one scope" ,
5370 tty : true ,
@@ -74,6 +91,7 @@ func Test_NewCmdRefresh(t *testing.T) {
7491 }
7592 io .SetStdinTTY (tt .tty )
7693 io .SetStdoutTTY (tt .tty )
94+ io .SetNeverPrompt (tt .neverPrompt )
7795
7896 argv , err := shlex .Split (tt .cli )
7997 assert .NoError (t , err )
You can’t perform that action at this time.
0 commit comments