From 0facf35d60013398fe4a1929b16d31161451a58f Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Fri, 14 Apr 2017 12:56:50 +1000 Subject: [PATCH] Fixed test flakeyness with using printf --- yaml_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/yaml_test.go b/yaml_test.go index b2af972a..60cc0a31 100644 --- a/yaml_test.go +++ b/yaml_test.go @@ -59,9 +59,11 @@ func TestUpdateYaml_WithScript(t *testing.T) { func TestNewYaml_WithScript(t *testing.T) { writeScript = "instruction_sample.yaml" + expectedResult := `b: + c: cat + e: + - name: Mike Farah` result := newYaml([]string{""}) - formattedResult := fmt.Sprintf("%v", result) - assertResult(t, - "[{b [{c cat} {e [[{name Mike Farah}]]}]}]", - formattedResult) + actualResult := yamlToString(result) + assertResult(t, expectedResult, actualResult) }