~axwalk/juju-core/api-uniter-machine

« back to all changes in this revision

Viewing changes to cmd/juju/removeuser_test.go

[r=dave-cheney] testing: make RunCommand variadic

This change alters the testing.RunCommand helper to be variadic. In terms of LOC this is probably a net nil, but being variadic this removes the requirement to wrap arguments to this method in a []string{ ... }

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
var _ = gc.Suite(&RemoveUserSuite{})
19
19
 
20
20
func (s *RemoveUserSuite) TestRemoveUser(c *gc.C) {
21
 
        _, err := testing.RunCommand(c, envcmd.Wrap(&UserAddCommand{}), []string{"foobar"})
 
21
        _, err := testing.RunCommand(c, envcmd.Wrap(&UserAddCommand{}), "foobar")
22
22
        c.Assert(err, gc.IsNil)
23
23
 
24
 
        _, err = testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), []string{"foobar"})
 
24
        _, err = testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), "foobar")
25
25
        c.Assert(err, gc.IsNil)
26
26
}
27
27
 
28
28
func (s *RemoveUserSuite) TestTooManyArgs(c *gc.C) {
29
 
        _, err := testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), []string{"foobar", "password"})
 
29
        _, err := testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), "foobar", "password")
30
30
        c.Assert(err, gc.ErrorMatches, `unrecognized args: \["password"\]`)
31
31
}
32
32
 
33
33
func (s *RemoveUserSuite) TestNotEnoughArgs(c *gc.C) {
34
 
        _, err := testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}), []string{})
 
34
        _, err := testing.RunCommand(c, envcmd.Wrap(&RemoveUserCommand{}))
35
35
        c.Assert(err, gc.ErrorMatches, `no username supplied`)
36
36
}