@@ -22,50 +22,57 @@ var _ = Describe("Config", func() {
2222 })
2323
2424 It ("can list environment variables" , func () {
25- out , err := execute ("deis config:set FOO=bar -a= %s" , appName )
25+ out , err := execute ("deis config:set FOO=bar -a %s" , appName )
2626 Expect (err ).NotTo (HaveOccurred ())
2727 Expect (out ).To (SatisfyAll (
2828 ContainSubstring ("Creating config... done" ),
2929 ContainSubstring ("FOO bar" ),
3030 ContainSubstring ("=== %s Config" , appName ),
3131 ))
32- out , err = execute ("deis config:list --a= %s" , appName )
32+ out , err = execute ("deis config:list -a %s" , appName )
3333 Expect (err ).NotTo (HaveOccurred ())
3434 Expect (out ).To (SatisfyAll (
3535 ContainSubstring ("=== %s Config" , appName ),
3636 ContainSubstring ("FOO bar" ),
3737 ))
3838 // TODO: the following won't work as-is because there is no app running
39- // "deis run env --app= %s"
39+ // "deis run env -a %s"
4040
4141 })
4242
43- XIt ("can set an integer environment variable" , func () {
44- // "deis config:set FOO=10 --app=%s"
45- // "deis run env --app=%s"
43+ It ("can set an integer environment variable" , func () {
44+ out , err := execute ("deis config:set FOO=1 -a %s" , appName )
45+ Expect (err ).NoTo (HaveOccurred ())
46+ Expect (out ).To (ContainSubstring ("FOO 1" ))
4647 })
4748
48- XIt ("can set an environment variable containing spaces" , func () {
49- // "config:set POWERED_BY=\"the Deis team\" --app={{.AppName}}"
50- // "deis run env --app=%s"
49+ It ("can set an environment variable containing spaces" , func () {
50+ out , err := execute (`deis config:set POWERED_BY=the\ Deis\ team -a %s` , appName )
51+ Expect (err ).NotTo (HaveOccurred ())
52+ Expect (out ).To (ContainSubstring ("POWERED_BY the Deis team" ))
5153 })
5254
53- XIt ("can set a multi-line environment variable" , func () {
54- // `deis config:set FOO="This is a
55- //multiline string" --app={{.AppName}}`
56- // "deis run env --app=%s"
55+ It ("can set a multi-line environment variable" , func () {
56+ out , err := execute (`deis config:set FOO=This\ is\ a\
57+ multiline\ string -a %s` , appName )
58+ Expect (err ).NotTo (HaveOccurred ())
59+ Expect (out ).To (ContainSubstring (`FOO This\ is\ a\
60+ multiline\ string` ))
5761 })
5862
59- XIt ("can set an environment variable with multibyte chars" , func () {
60- // "deis config:set FOO=讲台 --app=%s"
61- // "deis run env --app=%s"
63+ It ("can set an environment variable with multibyte chars" , func () {
64+ out , err := execute ("deis config:set FOO=讲台 -a %s" , test1 )
65+ Expect (err ).NotTo (HaveOccurred ())
66+ Expect (out ).To (ContainSubstring ("FOO 讲台" ))
6267 })
6368
64- XIt ("can unset an environment variable" , func () {
65- // "deis config:set FOO=bar --app=%s"
66- // "deis run env --app=%s"
67- // "deis config:unset FOO --app=%s"
68- // "deis run env --app=%s"
69+ It ("can unset an environment variable" , func () {
70+ out , err := execute ("deis config:set FOO=bar -a %s" , appName )
71+ Expect (err ).NotTo (HaveOccurred ())
72+ Expect (out ).To (ContainSubstring ("FOO bar" ))
73+ out , err = execute ("deis config:unset FOO -a %s" , appName )
74+ Expect (err ).NotTo (HaveOccurred ())
75+ Expect (out ).NotTo (ContainSubstring ("FOO" ))
6976 })
7077
7178 XIt ("can pull the configuration to an .env file" , func () {
0 commit comments