github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/cmd/juju/romulus/commands/commands_test.go (about) 1 // Copyright 2016 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package commands_test 5 6 import ( 7 stdtesting "testing" 8 9 "github.com/juju/cmd" 10 gc "gopkg.in/check.v1" 11 12 "github.com/juju/juju/cmd/juju/romulus/commands" 13 ) 14 15 type commandSuite struct{} 16 17 var _ = gc.Suite(&commandSuite{}) 18 19 type mockRegister struct { 20 commands []string 21 } 22 23 func (m *mockRegister) Register(command cmd.Command) { 24 m.commands = append(m.commands, command.Info().Name) 25 } 26 27 func TestAll(t *stdtesting.T) { 28 gc.TestingT(t) 29 } 30 31 func (s *commandSuite) TestRegister(c *gc.C) { 32 m := &mockRegister{} 33 commands.RegisterAll(m) 34 c.Assert(m.commands, gc.DeepEquals, []string{ 35 "agree", 36 "agreements", 37 "budget", 38 "create-wallet", 39 "plans", 40 "set-wallet", 41 "set-plan", 42 "show-wallet", 43 "sla", 44 "wallets", 45 }) 46 }