|
1 | 1 | package completion_test |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "os" |
5 | 4 | "strings" |
6 | 5 |
|
7 | | - "github.com/cloudfoundry/bosh-utils/logger" |
| 6 | + boshlog "github.com/cloudfoundry/bosh-utils/logger" |
8 | 7 | . "github.com/onsi/ginkgo/v2" |
9 | 8 | . "github.com/onsi/gomega" |
10 | 9 |
|
11 | 10 | "github.com/cloudfoundry/bosh-cli/v7/cmd/completion" |
12 | 11 | ) |
13 | 12 |
|
14 | 13 | var _ = Describe("Completion Integration Tests", func() { |
15 | | - var ( |
16 | | - boshComplete *completion.BoshComplete |
17 | | - ) |
| 14 | + var boshComplete *completion.BoshComplete |
18 | 15 |
|
19 | 16 | BeforeEach(func() { |
20 | | - testLogger := logger.NewWriterLogger(logger.LevelInfo, os.Stderr) |
| 17 | + testLogger := boshlog.NewWriterLogger(boshlog.LevelInfo, GinkgoWriter) |
21 | 18 | fakeCmdCtx := &completion.CmdContext{} |
22 | 19 | fakeDq := completion.NewDirectorQueryFake(fakeCmdCtx) |
23 | | - fakeCompletionFunctionMap := completion.NewCompleteFunctionsMap(testLogger, fakeDq) |
| 20 | + fakeCompletionFunctionMap := |
| 21 | + completion.NewCompleteFunctionsMap(testLogger, fakeDq) |
| 22 | + |
24 | 23 | boshComplete = completion.NewBoshCompleteWithFunctions(testLogger, fakeCmdCtx, fakeCompletionFunctionMap) |
25 | 24 | }) |
26 | 25 |
|
@@ -130,9 +129,8 @@ func (tc testCase) check(boshComplete *completion.BoshComplete) { |
130 | 129 | } else { |
131 | 130 | Expect(err).ToNot(HaveOccurred()) |
132 | 131 | } |
133 | | - if result == nil { |
134 | | - Expect(result).ToNot(BeNil()) |
135 | | - } |
| 132 | + Expect(result).ToNot(BeNil()) |
| 133 | + |
136 | 134 | if tc.wantStartsWith { |
137 | 135 | for i, wantLine := range tc.wantRes { |
138 | 136 | Expect(wantLine).To(Equal(result.Lines[i])) |
|
0 commit comments