mirror of
https://github.com/volatiletech/authboss.git
synced 2024-11-24 08:42:17 +02:00
f12f10fa43
- This change was necessary because multi-tenancy sites could not use authboss properly.
30 lines
517 B
Go
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)
|
|
}
|
|
}
|