(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestAlreadyRebuildingCodespace(t *testing.T) { |
| 12 | rebuildingCodespace := &api.Codespace{ |
| 13 | Name: "rebuildingCodespace", |
| 14 | State: api.CodespaceStateRebuilding, |
| 15 | } |
| 16 | app := testingRebuildApp(*rebuildingCodespace) |
| 17 | selector := &CodespaceSelector{api: app.apiClient, codespaceName: "rebuildingCodespace"} |
| 18 | |
| 19 | err := app.Rebuild(context.Background(), selector, false) |
| 20 | if err != nil { |
| 21 | t.Errorf("rebuilding a codespace that was already rebuilding: %v", err) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | func testingRebuildApp(mockCodespace api.Codespace) *App { |
| 26 | apiMock := &apiClientMock{ |
nothing calls this directly
no test coverage detected