Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Unified Diff: cmd/juju/main_test.go

Issue 13642045: Always show cmd errors/warnings (Closed)
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « [revision details] ('k') | cmd/juju/plugin_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmd/juju/main_test.go
=== modified file 'cmd/juju/main_test.go'
--- cmd/juju/main_test.go 2013-09-12 04:11:32 +0000
+++ cmd/juju/main_test.go 2013-09-20 06:08:19 +0000
@@ -23,6 +23,7 @@
"launchpad.net/juju-core/juju/osenv"
_ "launchpad.net/juju-core/provider/dummy"
"launchpad.net/juju-core/testing"
+ jc "launchpad.net/juju-core/testing/checkers"
"launchpad.net/juju-core/version"
)
@@ -116,7 +117,7 @@
summary: "juju help foo doesn't exist",
args: []string{"help", "foo"},
code: 1,
- out: "error: unknown command or topic for foo\n",
+ out: "ERROR unknown command or topic for foo\n",
}, {
summary: "juju help deploy shows the default help without global options",
args: []string{"help", "deploy"},
@@ -136,7 +137,7 @@
summary: "unknown command",
args: []string{"discombobulate"},
code: 1,
- out: "error: unrecognized command: juju discombobulate\n",
+ out: "ERROR unrecognized command: juju discombobulate\n",
}, {
summary: "unknown option before command",
args: []string{"--cheese", "bootstrap"},
@@ -193,10 +194,10 @@
msg := breakJuju(c, "Bootstrap")
logpath := filepath.Join(c.MkDir(), "log")
out := badrun(c, 1, "--log-file", logpath, "bootstrap")
- c.Assert(out, gc.Equals, "error: "+msg+"\n")
+ c.Assert(out, jc.HasSuffix, "ERROR "+msg+"\n")
content, err := ioutil.ReadFile(logpath)
c.Assert(err, gc.IsNil)
- fullmsg := fmt.Sprintf(`(.|\n)*ERROR .* command failed: %s\n`, msg)
+ fullmsg := fmt.Sprintf(`(.|\n)*ERROR .* %s\n`, msg)
c.Assert(string(content), gc.Matches, fullmsg)
}
@@ -206,10 +207,10 @@
msg := breakJuju(c, "Bootstrap")
logpath := filepath.Join(c.MkDir(), "log")
out := badrun(c, 1, "bootstrap", "--log-file", logpath)
- c.Assert(out, gc.Equals, "error: "+msg+"\n")
+ c.Assert(out, jc.HasSuffix, "ERROR "+msg+"\n")
content, err := ioutil.ReadFile(logpath)
c.Assert(err, gc.IsNil)
- fullmsg := fmt.Sprintf(`(.|\n)*ERROR .* command failed: %s\n`, msg)
+ fullmsg := fmt.Sprintf(`(.|\n)*ERROR .* %s\n`, msg)
c.Assert(string(content), gc.Matches, fullmsg)
}
« no previous file with comments | « [revision details] ('k') | cmd/juju/plugin_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b