func (s *updateCloudsSuite) run(c *gc.C, url, errMsg string) string { updateCmd := cloud.NewUpdateCloudsCommandForTest(url) out, err := testing.RunCommand(c, updateCmd) if errMsg == "" { c.Assert(err, jc.ErrorIsNil) } else { errString := strings.Replace(err.Error(), "\n", "", -1) c.Assert(errString, gc.Matches, errMsg) } return testing.Stderr(out) }
func (s *updateCloudsSuite) TestBadArgs(c *gc.C) { updateCmd := cloud.NewUpdateCloudsCommandForTest("") _, err := testing.RunCommand(c, updateCmd, "extra") c.Assert(err, gc.ErrorMatches, `unrecognized args: \["extra"\]`) }