(t *testing.T)
| 16 | ) |
| 17 | |
| 18 | func Test_NewCmdLogout(t *testing.T) { |
| 19 | tests := []struct { |
| 20 | name string |
| 21 | cli string |
| 22 | wants LogoutOptions |
| 23 | tty bool |
| 24 | }{ |
| 25 | { |
| 26 | name: "nontty no arguments", |
| 27 | cli: "", |
| 28 | wants: LogoutOptions{}, |
| 29 | }, |
| 30 | { |
| 31 | name: "tty no arguments", |
| 32 | tty: true, |
| 33 | cli: "", |
| 34 | wants: LogoutOptions{}, |
| 35 | }, |
| 36 | { |
| 37 | name: "tty with hostname", |
| 38 | tty: true, |
| 39 | cli: "--hostname github.com", |
| 40 | wants: LogoutOptions{ |
| 41 | Hostname: "github.com", |
| 42 | }, |
| 43 | }, |
| 44 | { |
| 45 | name: "nontty with hostname", |
| 46 | cli: "--hostname github.com", |
| 47 | wants: LogoutOptions{ |
| 48 | Hostname: "github.com", |
| 49 | }, |
| 50 | }, |
| 51 | { |
| 52 | name: "tty with user", |
| 53 | tty: true, |
| 54 | cli: "--user monalisa", |
| 55 | wants: LogoutOptions{ |
| 56 | Username: "github.com", |
| 57 | }, |
| 58 | }, |
| 59 | { |
| 60 | name: "nontty with user", |
| 61 | cli: "--user monalisa", |
| 62 | wants: LogoutOptions{ |
| 63 | Username: "github.com", |
| 64 | }, |
| 65 | }, |
| 66 | { |
| 67 | name: "tty with hostname and user", |
| 68 | tty: true, |
| 69 | cli: "--hostname github.com --user monalisa", |
| 70 | wants: LogoutOptions{ |
| 71 | Hostname: "github.com", |
| 72 | Username: "monalisa", |
| 73 | }, |
| 74 | }, |
| 75 | { |
nothing calls this directly
no test coverage detected