(t *testing.T)
| 302 | } |
| 303 | |
| 304 | func TestDeferredRepositoryCleanup(t *testing.T) { |
| 305 | file := filepath.Join(t.TempDir(), "cleanup.txt") |
| 306 | require.NoError(t, os.WriteFile(file, []byte("fixture-repo none\ndefer cleanup-repo stale-repo\n"), 0o600)) |
| 307 | |
| 308 | client := &fakeFixtureRepositoryClient{} |
| 309 | manager := &fixtureRepositoryManager{client: client} |
| 310 | tsEnv := testScriptEnv{ |
| 311 | host: "github.com", |
| 312 | org: "example", |
| 313 | token: "ghs_token", |
| 314 | } |
| 315 | t.Run("script", func(t *testing.T) { |
| 316 | testscript.Run(t, testscript.Params{ |
| 317 | Files: []string{file}, |
| 318 | Setup: sharedSetup(tsEnv), |
| 319 | Cmds: sharedCmds(tsEnv, manager), |
| 320 | RequireExplicitExec: true, |
| 321 | }) |
| 322 | }) |
| 323 | |
| 324 | assert.Equal(t, []string{"stale-repo"}, client.deleted) |
| 325 | } |
| 326 | |
| 327 | func TestManagedFixtureRejectsRepositoryCreation(t *testing.T) { |
| 328 | file := filepath.Join(t.TempDir(), "managed.txt") |
nothing calls this directly
no test coverage detected