Skip to content

Commit 3c9c75e

Browse files
allmightyspiffGitHub Enterprise
authored andcommitted
Merge pull request #821 from SoftLayer/issues783
Removed --details from 'globalip unassign' as it did nothing
2 parents bdb5b06 + 545da52 commit 3c9c75e

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

plugin/commands/globalip/unassign.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ type UnassignCommand struct {
1313
*metadata.SoftlayerCommand
1414
NetworkManager managers.NetworkManager
1515
Command *cobra.Command
16-
Details bool
1716
}
1817

1918
func NewUnassignCommand(sl *metadata.SoftlayerCommand) *UnassignCommand {
@@ -29,7 +28,6 @@ func NewUnassignCommand(sl *metadata.SoftlayerCommand) *UnassignCommand {
2928
return thisCmd.Run(args)
3029
},
3130
}
32-
cobraCmd.Flags().BoolVar(&thisCmd.Details, "details", false, T("Shows a very detailed list of charges"))
3331
thisCmd.Command = cobraCmd
3432
return thisCmd
3533
}

plugin/commands/globalip/unassign_test.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package globalip_test
22

33
import (
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

Comments
 (0)