Skip to content

Commit 3993899

Browse files
committed
fix test
1 parent 1695795 commit 3993899

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

commands/status_test.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,30 @@ func TestFailedGetServicesStatusCommand(t *testing.T) {
166166

167167
assertExecGotError(t, cmd, "exec err")
168168

169-
expected := "No services found."
169+
expected := ""
170170

171171
output := fmt.Sprint(f.shell.(*shell.FakeShell).WarningOutput...)
172172

173173
if output != expected {
174174
t.Errorf("Expected '%s', got '%s'", expected, output)
175175
}
176+
177+
f.getServicesCmd.(*builder.FakeCommand).MockExecError = nil
178+
179+
if err := cmd.Execute(); err != nil {
180+
t.Errorf("unexpected error: %v", err)
181+
}
182+
183+
fmt.Println("outputs", f.shell.(*shell.FakeShell).WarningOutput, f.shell.(*shell.FakeShell).OutLines, f.shell.(*shell.FakeShell).SuccessOutput)
184+
t.Error("error")
185+
186+
expected = "No services found."
187+
188+
output = fmt.Sprint(f.shell.(*shell.FakeShell).WarningOutput...)
189+
190+
if output != expected {
191+
t.Errorf("Expected '%s', got '%s'", expected, output)
192+
}
176193
}
177194

178195
func TestFailedDependenciesStatusCommand(t *testing.T) {

0 commit comments

Comments
 (0)