From be8a2212d88dac5e16ee69d81918eaed31b06ae4 Mon Sep 17 00:00:00 2001 From: Chase Hutchins Date: Fri, 29 Jan 2016 04:31:34 -0800 Subject: [PATCH] adding tests for setting log output and prefix to make coveralls happy --- echo_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/echo_test.go b/echo_test.go index fe4344d7..84d52309 100644 --- a/echo_test.go +++ b/echo_test.go @@ -1,6 +1,7 @@ package echo import ( + "bufio" "bytes" "fmt" "net/http" @@ -41,6 +42,20 @@ func TestEcho(t *testing.T) { assert.Equal(t, http.StatusInternalServerError, rec.Code) } +func TestLogger(t *testing.T) { + prefix := "extremely-long-prefix-string-that-wont-exist" + e := New() + + var b bytes.Buffer + out := bufio.NewWriter(&b) + + e.logger.SetPrefix(prefix) + e.logger.SetOutput(out) + e.logger.Print("test") + + assert.Contains(t, "extremely-long-prefix-string", b.String()) +} + func TestEchoIndex(t *testing.T) { e := New() e.Index("_fixture/index.html")