@@ -3,6 +3,8 @@ package _tests_test
33import (
44 . "github.com/onsi/ginkgo"
55 . "github.com/onsi/gomega"
6+ "github.com/onsi/gomega/gbytes"
7+ "github.com/onsi/gomega/gexec"
68)
79
810var _ = Describe ("Apps" , func () {
@@ -14,49 +16,57 @@ var _ = Describe("Apps", func() {
1416 })
1517
1618 It ("can't get app info" , func () {
17- Expect (execute ("deis info -a %s" , app1Name )).To (BeASuccessfulCmdWithOutput (ContainSubstring ("NOT FOUND" )))
19+ sess , err := start ("deis info -a %s" , app1Name )
20+ Expect (err ).ToNot (BeNil ())
21+ Eventually (sess ).ShouldNot (gexec .Exit (0 ))
22+ Eventually (sess ).Should (gbytes .Say ("NOT FOUND" ))
1823 })
1924
2025 It ("can't get app logs" , func () {
21- out , err := execute ("deis logs -a %s" , app1Name )
22- Expect (err ).To (HaveOccurred ())
23- Expect (out ).To (ContainSubstring ("NOT FOUND" ))
26+ sess , err := start ("deis logs -a %s" , app1Name )
27+ Expect (err ).To (BeNil ())
28+ Eventually (sess ).ShouldNot (gexec .Exit (0 ))
29+ Eventually (sess ).Should (gbytes .Say ("NOT FOUND" ))
2430 })
2531
2632 // TODO: this currently returns "Error: json: cannot unmarshal object into Go value of type []interface {}"
2733 XIt ("can't run a command in the app environment" , func () {
28- out , err := execute ("deis apps:run echo Hello, 世界" )
29- Expect (err ).To (HaveOccurred ())
30- Expect (out ).To (ContainSubstring ("NOT FOUND" ))
34+ sess , err := start ("deis apps:run echo Hello, 世界" )
35+ Expect (err ).To (BeNil ())
36+ Eventually (sess ).ShouldNot (gexec .Exit (0 ))
37+ Eventually (sess ).Should (gbytes .Say ("NOT FOUND" ))
3138 })
3239
3340 It ("can create an app" , func () {
34- Expect (execute ("deis apps:create %s" , app1Name )).To (BeASuccessfulCmdWithOutput (
35- ContainSubstring ("Creating Application... done, created %s" , app1Name ),
36- ContainSubstring ("Git remote deis added" ),
37- ContainSubstring ("remote available at " ),
38- ))
39-
40- Expect (execute ("deis apps:destroy --confirm=%s" , app1Name )).To (BeASuccessfulCmdWithOutput (
41- ContainSubstring ("Destroying %s..." , app1Name ),
42- ContainSubstring ("done in " ),
43- ContainSubstring ("Git remote deis removed" ),
44- ))
41+ sess , err := start ("deis apps:create %s" , app1Name )
42+ Expect (err ).To (BeNil ())
43+ Eventually (sess ).Should (gexec .Exit (0 ))
44+ Eventually (sess ).Should (gbytes .Say ("Creating Application... done, created %s" , app1Name ))
45+ Eventually (sess ).Should (gbytes .Say ("Git remote deis added" ))
46+ Eventually (sess ).Should (gbytes .Say ("remote available at " ))
47+
48+ sess , err = start ("deis apps:destroy --confirm=%s" , app1Name )
49+ Expect (err ).To (BeNil ())
50+ Eventually (sess ).Should (gexec .Exit (0 ))
51+ Eventually (sess ).Should (gbytes .Say ("Destroying %s..." , app1Name ))
52+ Eventually (sess ).Should (gbytes .Say ("done in " ))
53+ Eventually (sess ).Should (gbytes .Say ("Git remote deis removed" ))
4554 })
4655
4756 It ("can create an app with no git remote" , func () {
48- output , err := execute ("deis apps:create %s --no-remote" , app1Name )
49- Expect (err ).NotTo (HaveOccurred ())
50- Expect (output ).To (SatisfyAll (
51- ContainSubstring ("Creating Application... done, created %s" , app1Name ),
52- ContainSubstring ("remote available at " )))
53- Expect (output ).NotTo (ContainSubstring ("Git remote deis added" ))
54- output , err = execute ("deis apps:destroy --app=%s --confirm=%s" , app1Name , app1Name )
55- Expect (err ).NotTo (HaveOccurred ())
56- Expect (output ).To (SatisfyAll (
57- ContainSubstring ("Destroying %s..." , app1Name ),
58- ContainSubstring ("done in " )))
59- Expect (output ).NotTo (ContainSubstring ("Git remote deis removed" ))
57+ sess , err := start ("deis apps:create %s --no-remote" , app1Name )
58+ Expect (err ).To (BeNil ())
59+ Eventually (sess ).Should (gexec .Exit (0 ))
60+ Eventually (sess ).Should (gbytes .Say ("Creating Application... done, created %s" , app1Name ))
61+ Eventually (sess ).Should (gbytes .Say ("remove available at " ))
62+ Eventually (sess ).ShouldNot (gbytes .Say ("git remote deis added" ))
63+
64+ sess , err = start ("deis apps:destroy --app=%s --confirm=%s" , app1Name , app1Name )
65+ Expect (err ).To (BeNil ())
66+ Eventually (sess ).Should (gexec .Exit (0 ))
67+ Eventually (sess ).Should (gbytes .Say ("Destroying %s..." , app1Name ))
68+ Eventually (sess ).Should (gbytes .Say ("done in " ))
69+ Eventually (sess ).ShouldNot (gbytes .Say ("Git remote deis removed" ))
6070 })
6171
6272 It ("can create an app with a custom buildpack" , func () {
0 commit comments