1
0
mirror of https://github.com/volatiletech/authboss.git synced 2024-11-24 08:42:17 +02:00
authboss/logger_test.go
Aaron f12f10fa43 Stop reliance on global scope.
- This change was necessary because multi-tenancy sites could not use
  authboss properly.
2015-03-31 12:34:03 -07:00

30 lines
517 B
Go

package authboss
import (
"bytes"
"io"
"log"
"strings"
"testing"
)
func TestDefaultLogger(t *testing.T) {
t.Parallel()
logger := NewDefaultLogger()
if logger == nil {
t.Error("Logger was not created.")
}
}
func TestDefaultLoggerOutput(t *testing.T) {
t.Parallel()
buffer := &bytes.Buffer{}
logger := (*DefaultLogger)(log.New(buffer, "", log.LstdFlags))
io.WriteString(logger, "hello world")
if s := buffer.String(); !strings.HasSuffix(s, "hello world\n") {
t.Error("Output was wrong:", s)
}
}