mirror of https://github.com/Marcusk19/dotctl
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
591 B
Go
23 lines
591 B
Go
package test
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"github.com/Marcusk19/bender/cmd"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPrettyCommand(t *testing.T) {
|
|
bender := cmd.RootCmd
|
|
actual := new(bytes.Buffer)
|
|
bender.SetOut(actual)
|
|
bender.SetErr(actual)
|
|
bender.SetArgs([]string{"pretty", "fixtures/test_pretty.txt"})
|
|
bender.Execute()
|
|
|
|
expected := "The end of this sentence should start a newline. \nThe next sentence should be indented below this one.\n\tHello this is the end of the text"
|
|
assert.Equal(t, expected, actual.String(), "actual value differs from expected")
|
|
}
|
|
|