(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestInfo(t *testing.T) { |
| 16 | out := bytes.NewBuffer(nil) |
| 17 | ctx := &Context{ |
| 18 | Name: "info", |
| 19 | Args: nil, |
| 20 | In: nil, |
| 21 | Out: out, |
| 22 | Context: context.New(&context.ClientContext{ |
| 23 | Namespace: "$unittest", |
| 24 | }, &context.ServerContext{ |
| 25 | StartAt: time.Now(), |
| 26 | }), |
| 27 | } |
| 28 | Info(ctx) |
| 29 | // t.Log(out.String()) |
| 30 | if strings.Index(out.String(), "ERR") == 0 { |
| 31 | t.Fail() |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func TestMonitor(t *testing.T) { |
| 36 | assert := assert.New(t) |