MCPcopy Index your code
hub / github.com/codegangsta/gin / Test_Runner_SetWriter

Function Test_Runner_SetWriter

lib/runner_test.go:71–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func Test_Runner_SetWriter(t *testing.T) {
72 buff := bytes.NewBufferString("")
73 expect(t, buff.String(), "")
74
75 bin := filepath.Join("test_fixtures", "writing_output")
76 if runtime.GOOS == "windows" {
77 bin += ".bat"
78 }
79
80 runner := gin.NewRunner(bin)
81 runner.SetWriter(buff)
82
83 cmd, err := runner.Run()
84 cmd.Wait()
85 expect(t, err, nil)
86
87 if runtime.GOOS == "windows" {
88 expect(t, buff.String(), "Hello world\r\n")
89 } else {
90 expect(t, buff.String(), "Hello world\n")
91 }
92}

Callers

nothing calls this directly

Calls 3

SetWriterMethod · 0.95
RunMethod · 0.95
expectFunction · 0.85

Tested by

no test coverage detected