(t *testing.T)
| 33 | } |
| 34 | |
| 35 | func TestShouldCopyToClipboard(t *testing.T) { |
| 36 | tests := []struct { |
| 37 | name string |
| 38 | configured string |
| 39 | flagValue *bool |
| 40 | want bool |
| 41 | }{ |
| 42 | { |
| 43 | name: "enabled by default", |
| 44 | want: true, |
| 45 | }, |
| 46 | { |
| 47 | name: "enabled by configuration", |
| 48 | configured: "enabled", |
| 49 | want: true, |
| 50 | }, |
| 51 | { |
| 52 | name: "explicit flag enables disabled configuration", |
| 53 | configured: "disabled", |
| 54 | flagValue: new(true), |
| 55 | want: true, |
| 56 | }, |
| 57 | { |
| 58 | name: "explicit flag disables enabled configuration", |
| 59 | configured: "enabled", |
| 60 | flagValue: new(false), |
| 61 | }, |
| 62 | } |
| 63 | |
| 64 | for _, tt := range tests { |
| 65 | t.Run(tt.name, func(t *testing.T) { |
| 66 | cfg := config.NewMockConfig() |
| 67 | if tt.configured != "" { |
| 68 | cfg.Set("", "clipboard", tt.configured) |
| 69 | } |
| 70 | |
| 71 | require.Equal(t, tt.want, ShouldCopyToClipboard(cfg, tt.flagValue)) |
| 72 | }) |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | func TestLogin(t *testing.T) { |
| 77 | tests := []struct { |
nothing calls this directly
no test coverage detected