(t *testing.T)
| 132 | } |
| 133 | |
| 134 | func TestUpdateEnvironment(t *testing.T) { |
| 135 | flags := newUpdateCommand(nil).Flags() |
| 136 | flags.Set("env-add", "toadd=newenv") |
| 137 | flags.Set("env-rm", "toremove") |
| 138 | |
| 139 | envs := []string{"toremove=theenvtoremove", "tokeep=value"} |
| 140 | |
| 141 | updateEnvironment(flags, &envs) |
| 142 | assert.Assert(t, is.Len(envs, 2)) |
| 143 | // Order has been removed in updateEnvironment (map) |
| 144 | sort.Strings(envs) |
| 145 | assert.Check(t, is.Equal("toadd=newenv", envs[0])) |
| 146 | assert.Check(t, is.Equal("tokeep=value", envs[1])) |
| 147 | } |
| 148 | |
| 149 | func TestUpdateEnvironmentWithDuplicateValues(t *testing.T) { |
| 150 | flags := newUpdateCommand(nil).Flags() |
nothing calls this directly
no test coverage detected
searching dependent graphs…