Use name from server when displaying create/update

Allows generated names from files to be displayed so users can
interact with them.
This commit is contained in:
Clayton Coleman
2015-02-06 11:57:52 -05:00
parent bb6b332a8b
commit 52c6c60b15
8 changed files with 82 additions and 42 deletions

View File

@@ -67,7 +67,7 @@ func TestUpdateObject(t *testing.T) {
cmd.Run(cmd, []string{})
// uses the name from the file, not the response
if buf.String() != "redis-master\n" {
if buf.String() != "foo\n" {
t.Errorf("unexpected output: %s", buf.String())
}
}
@@ -104,7 +104,7 @@ func TestUpdateMultipleObject(t *testing.T) {
cmd.Flags().Set("filename", "../../../examples/guestbook/frontend-service.json")
cmd.Run(cmd, []string{})
if buf.String() != "redis-master\nfrontend\n" {
if buf.String() != "foo\nbaz\n" {
t.Errorf("unexpected output: %s", buf.String())
}
}
@@ -139,7 +139,7 @@ func TestUpdateDirectory(t *testing.T) {
cmd.Flags().Set("namespace", "test")
cmd.Run(cmd, []string{})
if buf.String() != "frontend-controller\nfrontend\nredis-master\nredis-master\nredis-slave-controller\nredisslave\n" {
if buf.String() != "qux\nbaz\nbaz\nfoo\nqux\nbaz\n" {
t.Errorf("unexpected output: %s", buf.String())
}
}