44 "errors"
55 "time"
66
7- . "github.com/IBM-Cloud/ibm-cloud-cli-sdk/testhelpers/matchers"
87 "github.com/IBM-Cloud/ibm-cloud-cli-sdk/testhelpers/terminal"
98 . "github.com/onsi/ginkgo/v2"
109 . "github.com/onsi/gomega"
@@ -26,7 +25,7 @@ var _ = Describe("Dedicated host detail", func() {
2625 )
2726 BeforeEach (func () {
2827 fakeUI = terminal .NewFakeUI ()
29- fakeSession = testhelpers .NewFakeSoftlayerSession ([] string {} )
28+ fakeSession = testhelpers .NewFakeSoftlayerSession (nil )
3029 slCommand = metadata .NewSoftlayerCommand (fakeUI , fakeSession )
3130 cliCommand = dedicatedhost .NewDetailCommand (slCommand )
3231 cliCommand .Command .PersistentFlags ().Var (cliCommand .OutputFlag , "output" , "--output=JSON for json output." )
@@ -111,35 +110,18 @@ var _ = Describe("Dedicated host detail", func() {
111110 It ("return no error" , func () {
112111 err := testhelpers .RunCobraCommand (cliCommand .Command , "1234" )
113112 Expect (err ).NotTo (HaveOccurred ())
114- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"1234" }))
115- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"dedicatedhost" }))
116- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"56" }))
117- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"1200" }))
118- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"242" }))
119- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"2022-02-01T00:00:00Z" }))
120- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"2022-02-01T00:00:00Z" }))
121- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"3" }))
122- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"dal13" }))
123- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"wilmawang" }))
113+ Expect (fakeUI .Outputs ()).To (ContainSubstring ("1234" ))
114+ Expect (fakeUI .Outputs ()).To (ContainSubstring ("dedicatedhost" ))
115+ Expect (fakeUI .Outputs ()).To (ContainSubstring ("dal13" ))
116+ Expect (fakeUI .Outputs ()).To (ContainSubstring ("wilmawang" ))
124117 })
125118 It ("return no error" , func () {
126119 err := testhelpers .RunCobraCommand (cliCommand .Command , "1234" , "--guests" , "--price" )
127120 Expect (err ).NotTo (HaveOccurred ())
128- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"1234" }))
129- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"dedicatedhost" }))
130- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"56" }))
131- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"1200" }))
132- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"242" }))
133- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"2022-02-01T00:00:00Z" }))
134- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"2022-02-01T00:00:00Z" }))
135- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"3" }))
136- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"dal13" }))
137- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"10" }))
138- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"wilmawang" }))
139- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"test.com" }))
140- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"test" }))
141- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"9131111-2222-6a10-3333-992c544444" }))
142- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([]string {"1234567" }))
121+ Expect (fakeUI .Outputs ()).To (ContainSubstring ("1234" ))
122+ Expect (fakeUI .Outputs ()).To (ContainSubstring ("dedicatedhost" ))
123+ Expect (fakeUI .Outputs ()).To (ContainSubstring ("9131111-2222-6a10-3333-992c544444" ))
124+ Expect (fakeUI .Outputs ()).To (ContainSubstring ("1234567" ))
143125 })
144126 })
145127 })
0 commit comments