Index: cmd/jujud/stater_test.go |
=== modified file 'cmd/jujud/stater_test.go' |
--- cmd/jujud/stater_test.go 2013-01-18 20:17:59 +0000 |
+++ cmd/jujud/stater_test.go 2013-01-18 20:30:14 +0000 |
@@ -6,9 +6,7 @@ |
"os" |
"path/filepath" |
- "bytes" |
. "launchpad.net/gocheck" |
- "launchpad.net/juju-core/cmd" |
"launchpad.net/juju-core/worker/stater" |
) |
@@ -61,12 +59,7 @@ |
} |
func (s *StaterSuite) TestStater(c *C) { |
- var stdout, stderr bytes.Buffer |
- ctx := &cmd.Context{ |
- Stdout: &stdout, |
- Stderr: &stderr, |
- } |
- code := cmd.Main(&StaterCommand{Config: s.config}, ctx, nil) |
+ stdout, stderr, code := runMain(&StaterCommand{Config: s.config}) |
c.Check(code, Equals, 0) |
c.Assert(stderr.String(), Equals, "") |
c.Assert(stdout.String(), Equals, "") |
@@ -75,12 +68,7 @@ |
} |
func (s *StaterSuite) TestStaterExtraArgs(c *C) { |
- var stdout, stderr bytes.Buffer |
- ctx := &cmd.Context{ |
- Stdout: &stdout, |
- Stderr: &stderr, |
- } |
- code := cmd.Main(&StaterCommand{Config: s.config}, ctx, []string{"foo"}) |
+ stdout, stderr, code := runMain(&StaterCommand{Config: s.config}, "foo") |
c.Check(code, Equals, 2) |
c.Assert(stdout.String(), Equals, "") |
c.Assert(stderr.String(), Matches, "error: unrecognized args.*\n") |