mirror of
https://github.com/onyx-and-iris/exclude.git
synced 2026-04-16 14:13:39 +00:00
remove the type assertions update the tests: the tests now check output as well as file contents separately.
25 lines
422 B
Go
25 lines
422 B
Go
package cmd
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
)
|
|
|
|
func TestRunResetCommand(t *testing.T) {
|
|
var out bytes.Buffer
|
|
var f seekBuffer
|
|
|
|
if err := resetAndWriteExcludeFile(&out, &f); err != nil {
|
|
t.Fatalf("resetAndWriteExcludeFile failed: %v", err)
|
|
}
|
|
|
|
if f.String() != defaultExcludeFileContent {
|
|
t.Errorf(
|
|
"unexpected content after reset:\nGot:\n%s\nExpected:\n%s",
|
|
f.String(),
|
|
defaultExcludeFileContent,
|
|
)
|
|
}
|
|
}
|
|
|