func (*writerBasicsSuite) TestReplaceDefaultWriterWithNil(c *gc.C) { oldWriter, err := loggo.ReplaceDefaultWriter(nil) c.Assert(oldWriter, gc.IsNil) c.Assert(err, gc.ErrorMatches, "Writer cannot be nil") }
func (*writerBasicsSuite) TestReplaceDefaultWriterNoDefault(c *gc.C) { loggo.RemoveWriter("default") oldWriter, err := loggo.ReplaceDefaultWriter(&loggo.TestWriter{}) c.Assert(oldWriter, gc.IsNil) c.Assert(err, gc.ErrorMatches, `there is no "default" writer`) }
func (*writerBasicsSuite) TestReplaceDefaultWriter(c *gc.C) { oldWriter, err := loggo.ReplaceDefaultWriter(&loggo.TestWriter{}) c.Assert(oldWriter, gc.NotNil) c.Assert(err, gc.IsNil) }