func (s *ListSuite) TestUnrecognizedArg(c *gc.C) { _, err := testing.RunCommand(c, system.NewListCommand(s.store), "whoops") c.Assert(err, gc.ErrorMatches, `unrecognized args: \["whoops"\]`) }
func (s *ListSuite) TestListSystemsError(c *gc.C) { s.store = errorStore{err: errors.New("cannot read info")} _, err := testing.RunCommand(c, system.NewListCommand(s.store)) c.Assert(err, gc.ErrorMatches, "failed to list systems in config store: cannot read info") }
func (s *ListSuite) TestSystemList(c *gc.C) { context, err := testing.RunCommand(c, system.NewListCommand(s.store)) c.Assert(err, jc.ErrorIsNil) c.Assert(testing.Stdout(context), gc.Equals, "test1\ntest3\n") }