Fix master branch
The test was failing on Windows
@@ -19,6 +19,7 @@ package main
import (
"bytes"
"io/ioutil"
+ "path/filepath"
"testing"
"github.com/GoogleContainerTools/skaffold/testutil"
@@ -40,11 +41,14 @@ func TestPrintMan(t *testing.T) {
testutil.CheckContains(t, "Env vars", output)
// Compare to current man page
- header, err := ioutil.ReadFile("../../../docs/content/en/docs/references/cli/index_header")
+ header, err := ioutil.ReadFile(filepath.Join("..", "..", "..", "docs", "content", "en", "docs", "references", "cli", "index_header"))
testutil.CheckError(t, false, err)
+ header = bytes.Replace(header, []byte("\r\n"), []byte("\n"), -1)
- expected, err := ioutil.ReadFile("../../../docs/content/en/docs/references/cli/_index.md")
+ expected, err := ioutil.ReadFile(filepath.Join("..", "..", "..", "docs", "content", "en", "docs", "references", "cli", "_index.md"))
testutil.CheckError(t, false, err)
+ expected = bytes.Replace(expected, []byte("\r\n"), []byte("\n"), -1)
+
if string(expected) != string(header)+output {
t.Error("You have skaffold command changes but haven't generated the CLI reference docs. Please run ./hack/generate-man.sh and commit the results!")
}
