func (*FlagSuite) TestFlagOutputBadTarget(c *gc.C) { in := &stubFlagWorker{} var out interface{} err := engine.FlagOutput(in, &out) c.Check(err, gc.ErrorMatches, `expected out to be a \*Flag; got a .*`) c.Check(out, gc.IsNil) }
func (*FlagSuite) TestFlagOutputSuccess(c *gc.C) { in := &stubFlagWorker{} var out engine.Flag err := engine.FlagOutput(in, &out) c.Check(err, jc.ErrorIsNil) c.Check(out, gc.Equals, in) }
func (*FlagSuite) TestFlagOutputBadWorker(c *gc.C) { in := &stubWorker{} var out engine.Flag err := engine.FlagOutput(in, &out) c.Check(err, gc.ErrorMatches, `expected in to implement Flag; got a .*`) c.Check(out, gc.IsNil) }