Skip to content

Commit ad3e831

Browse files
committed
new tests for capture output removed redundant api call
1 parent c6d2f85 commit ad3e831

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
package capture_output
22

33
import (
4+
"fmt"
45
"testing"
56

6-
"github.com/Robert076/code-buddy/internal/command/gitignore_command/gitignore_go"
77
"github.com/stretchr/testify/assert"
88
)
99

1010
func TestCaptureOutput(t *testing.T) {
11-
cmd := &gitignore_go.GitignoreCommandGo{}
1211
output := CaptureOutput(func() {
13-
cmd.Run([]string{})
12+
fmt.Print("Hello world")
1413
})
15-
assert.Contains(t, output, ".env")
16-
assert.Contains(t, output, "# env file")
17-
assert.Contains(t, output, ".exe")
14+
assert.Contains(t, output, "Hello")
15+
assert.Contains(t, output, "world")
1816
}

0 commit comments

Comments
 (0)