mirror of https://github.com/docker/cli.git
cli/command: use more descriptive const in test
On failures, the output wasn't clear which side was "expected" and which side was "actual". Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
acb934cc9d
commit
0cc3f688d6
|
@ -16,7 +16,8 @@ func TestDockerContextMetadataKeepAdditionalFields(t *testing.T) {
|
||||||
}
|
}
|
||||||
jsonBytes, err := json.Marshal(c)
|
jsonBytes, err := json.Marshal(c)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Equal(t, `{"Description":"test","foo":"bar"}`, string(jsonBytes))
|
const expected = `{"Description":"test","foo":"bar"}`
|
||||||
|
assert.Equal(t, string(jsonBytes), expected)
|
||||||
|
|
||||||
var c2 DockerContext
|
var c2 DockerContext
|
||||||
assert.NilError(t, json.Unmarshal(jsonBytes, &c2))
|
assert.NilError(t, json.Unmarshal(jsonBytes, &c2))
|
||||||
|
|
Loading…
Reference in New Issue