Пример #1
0
func (*FlagSuite) TestFlagOutputBadTarget(c *gc.C) {
	in := &stubFlagWorker{}
	var out interface{}
	err := util.FlagOutput(in, &out)
	c.Check(err, gc.ErrorMatches, `expected out to be a \*Flag; got a .*`)
	c.Check(out, gc.IsNil)
}
Пример #2
0
func (*FlagSuite) TestFlagOutputSuccess(c *gc.C) {
	in := &stubFlagWorker{}
	var out util.Flag
	err := util.FlagOutput(in, &out)
	c.Check(err, jc.ErrorIsNil)
	c.Check(out, gc.Equals, in)
}
Пример #3
0
func (*FlagSuite) TestFlagOutputBadWorker(c *gc.C) {
	in := &stubWorker{}
	var out util.Flag
	err := util.FlagOutput(in, &out)
	c.Check(err, gc.ErrorMatches, `expected in to implement Flag; got a .*`)
	c.Check(out, gc.IsNil)
}