@@ -2,9 +2,7 @@ package globalip_test
22
33import (
44 "errors"
5- "strings"
65
7- . "github.com/IBM-Cloud/ibm-cloud-cli-sdk/testhelpers/matchers"
86 "github.com/IBM-Cloud/ibm-cloud-cli-sdk/testhelpers/terminal"
97 . "github.com/onsi/ginkgo"
108 . "github.com/onsi/gomega"
@@ -37,14 +35,14 @@ var _ = Describe("GlobalIP unassign", func() {
3735 It ("return error" , func () {
3836 err := testhelpers .RunCobraCommand (cliCommand .Command )
3937 Expect (err ).To (HaveOccurred ())
40- Expect (strings . Contains ( err .Error (), "Incorrect Usage: This command requires one argument" )). To ( BeTrue ( ))
38+ Expect (err .Error ()). To ( ContainSubstring ( "Incorrect Usage: This command requires one argument" ))
4139 })
4240 })
4341 Context ("GlobalIP unassign with wrong IP ID" , func () {
4442 It ("return error" , func () {
4543 err := testhelpers .RunCobraCommand (cliCommand .Command , "abc" )
4644 Expect (err ).To (HaveOccurred ())
47- Expect (strings . Contains ( err .Error (), "Invalid input for 'Globalip ID'. It must be a positive integer." )). To ( BeTrue ( ))
45+ Expect (err .Error ()). To ( ContainSubstring ( "Invalid input for 'Globalip ID'. It must be a positive integer." ))
4846 })
4947 })
5048
@@ -55,8 +53,8 @@ var _ = Describe("GlobalIP unassign", func() {
5553 It ("return error" , func () {
5654 err := testhelpers .RunCobraCommand (cliCommand .Command , "1234" )
5755 Expect (err ).To (HaveOccurred ())
58- Expect (strings . Contains ( err .Error (), "Failed to unassign global IP 1234." )). To ( BeTrue ( ))
59- Expect (strings . Contains ( err .Error (), "Internal Server Error" )). To ( BeTrue ( ))
56+ Expect (err .Error ()). To ( ContainSubstring ( "Failed to unassign global IP 1234." ))
57+ Expect (err .Error ()). To ( ContainSubstring ( "Internal Server Error" ))
6058 })
6159 })
6260
@@ -67,8 +65,8 @@ var _ = Describe("GlobalIP unassign", func() {
6765 It ("return no error" , func () {
6866 err := testhelpers .RunCobraCommand (cliCommand .Command , "1234" )
6967 Expect (err ).NotTo (HaveOccurred ())
70- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([] string { "OK" } ))
71- Expect (fakeUI .Outputs ()).To (ContainSubstrings ([] string { "The transaction to unroute a global IP address is created, routes will be updated in one or two minutes." } ))
68+ Expect (fakeUI .Outputs ()).To (ContainSubstring ( "OK" ))
69+ Expect (fakeUI .Outputs ()).To (ContainSubstring ( "The transaction to unroute a global IP address is created, routes will be updated in one or two minutes." ))
7270 })
7371 })
7472 })
0 commit comments