Skip to content

Commit 26f59b2

Browse files
committed
cli/compose/loader: use golden.Assert() for readability
golden.AssertBytes prints the failure as a bytes-array, which makes it not human-readable; let's compare strings instead. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 5c6ca07 commit 26f59b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cli/compose/loader/types_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestMarshallConfig(t *testing.T) {
1717

1818
actual, err := yaml.Marshal(cfg)
1919
assert.NilError(t, err)
20-
golden.AssertBytes(t, actual, "full-example.yaml.golden")
20+
golden.Assert(t, string(actual), "full-example.yaml.golden")
2121

2222
// Make sure the expected can be parsed.
2323
yamlData, err := os.ReadFile("testdata/full-example.yaml.golden")
@@ -34,7 +34,7 @@ func TestJSONMarshallConfig(t *testing.T) {
3434
cfg := fullExampleConfig(workingDir, homeDir)
3535
actual, err := json.MarshalIndent(cfg, "", " ")
3636
assert.NilError(t, err)
37-
golden.AssertBytes(t, actual, "full-example.json.golden")
37+
golden.Assert(t, string(actual), "full-example.json.golden")
3838

3939
jsonData, err := os.ReadFile("testdata/full-example.json.golden")
4040
assert.NilError(t, err)

0 commit comments

Comments
 (0)