~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/romulus/cmd/commands/commands_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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/romulus/cmd/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
                "allocate",
 
38
                "budgets",
 
39
                "create-budget",
 
40
                "plans",
 
41
                "set-budget",
 
42
                "set-plan",
 
43
                "show-budget",
 
44
                "update-allocation",
 
45
        })
 
46
}