diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-05 11:25:57 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-05 11:25:57 +0300 |
| commit | 4c5b95d5e3811025e2148a6f2a059738e79ca2c9 (patch) | |
| tree | e0aaaef14e1ed6fc0d78c460b671289e39e94c73 /internal/resource/resource_test.go | |
| parent | 5256a4d1e5a56510758bfac710ba2ad2a45af66e (diff) | |
add tests for repository's Apply
Diffstat (limited to 'internal/resource/resource_test.go')
| -rw-r--r-- | internal/resource/resource_test.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/internal/resource/resource_test.go b/internal/resource/resource_test.go index 8741f2a..23be8cc 100644 --- a/internal/resource/resource_test.go +++ b/internal/resource/resource_test.go @@ -5,7 +5,7 @@ import ( ) func TestResourceID(t *testing.T) { - resetRepository() + ResetRepository() res := Register("File", "/tmp/foo.txt", &mockApplier{}) expected := "File[/tmp/foo.txt]" if res.ID() != expected { @@ -14,7 +14,7 @@ func TestResourceID(t *testing.T) { } func TestResourceString(t *testing.T) { - resetRepository() + ResetRepository() res := Register("File", "/tmp/foo.txt", &mockApplier{}) expected := "File[/tmp/foo.txt]" if res.String() != expected { @@ -23,7 +23,7 @@ func TestResourceString(t *testing.T) { } func TestNew(t *testing.T) { - resetRepository() + ResetRepository() type_ := "File" name := "/tmp/foo.txt" res := Register(type_, name, &mockApplier{}) @@ -40,7 +40,7 @@ func TestNew(t *testing.T) { } func TestRepositoryRegister(t *testing.T) { - resetRepository() + ResetRepository() repo := getRepository() res := Register("File", "/tmp/foo.txt", &mockApplier{}) @@ -56,7 +56,3 @@ func TestRepositoryRegister(t *testing.T) { t.Error("expected error when registering the same resource twice, got nil") } } - -type mockApplier struct{} - -func (m *mockApplier) Apply() error { return nil } |
