@@ -29,49 +29,45 @@ setup() {
2929
3030 run ops -login -h
3131 assert_line " Usage:"
32- assert_line " ops login <apihost> [<user>]"
32+ assert_line " ops - login <apihost> [<user>]"
3333}
3434
3535@test " ops -login with OPS_PASSWORD env does not prompt for password" {
3636 export OPS_PASSWORD=1234
37- run ops -login localhost
37+ run ops -login nuvolaris.dev
38+ assert_line --partial " Logging in https://nuvolaris.dev"
3839 refute_line " Enter Password:"
3940}
4041
4142@test " ops -login with OPS_USER env defines username" {
4243 export OPS_PASSWORD=1234
4344 export OPS_USER=foo
44- run ops -login localhost
45- assert_line " Logging in as foo to localhost"
45+ run ops -login http://localhost
46+ assert_failure
47+ assert_line " Logging in http://localhost as foo"
4648}
4749
4850@test " ops -login with OPS_USER and OPS_PASSWORD env" {
4951 export OPS_PASSWORD=1234
5052 export OPS_USER=foo
5153 run ops -login localhost
52- assert_line " Logging in as foo to localhost "
54+ assert_line " Logging in http://localhost as foo"
5355 refute_line " Enter Password:"
5456}
5557
5658@test " ops -login with OPS_APIHOST env" {
5759 export OPS_APIHOST=localhost
5860 export OPS_PASSWORD=1234
61+ unset OPS_USER
5962 run ops -login
60- assert_line " Logging in as nuvolaris to localhost"
63+ assert_failure
64+ assert_line " Logging in http://localhost as nuvolaris"
6165}
6266
6367@test " ops -login with OPS_APIHOST and OPS_USER env" {
6468 export OPS_APIHOST=localhost
6569 export OPS_USER=foo
6670 export OPS_PASSWORD=1234
6771 run ops -login
68- assert_line " Logging in as foo to localhost "
72+ assert_line " Logging in http://localhost as foo"
6973}
70-
71- @test " ops -login with OPS_APIHOST, user is now first argument" {
72- export OPS_APIHOST=localhost
73- export OPS_PASSWORD=1234
74- run ops -login hello
75- assert_line " Logging in as hello to localhost"
76- refute_line " Enter Password:"
77- }
0 commit comments