docs/libmachine/log/machine_formatter_test.go

18 lines
343 B
Go

package log
import (
"testing"
"github.com/Sirupsen/logrus"
"github.com/stretchr/testify/assert"
)
func TestWrite(t *testing.T) {
entry := logrus.NewEntry(logrus.New())
entry.Message = "foobar"
formatter := MachineFormatter{}
bytes, err := formatter.Format(entry)
assert.Nil(t, err)
assert.Equal(t, string(bytes[:]), "foobar\n")
}