diff options
| author | mo khan <mo@mokhan.ca> | 2025-06-13 15:07:08 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-06-13 15:07:08 -0600 |
| commit | 24e77fe48f88d91c5e1ee4aac3473f750c08272b (patch) | |
| tree | d7cf6341a41ca85f73a700a3411859858b625f75 | |
| parent | d99a5c5c857d853873342aa567e42c80fd8d0a28 (diff) | |
test: add a simple test for the All() method
| -rw-r--r-- | app/db/in_memory_repository_test.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/app/db/in_memory_repository_test.go b/app/db/in_memory_repository_test.go index 9c44fa7..cfbab41 100644 --- a/app/db/in_memory_repository_test.go +++ b/app/db/in_memory_repository_test.go @@ -98,18 +98,13 @@ func TestInMemoryRepository(t *testing.T) { Reason: "because", })) - t.Run("prevents unintended modifications", func(t *testing.T) { + t.Run("returns all the items", func(t *testing.T) { items := repository.All(t.Context()) - require.Equal(t, 1, len(items)) - - sparkle := items[0] - sparkle.Reason = "haha" - - assert.Equal(t, "because", repository.All(t.Context())[0].Reason) - }) - t.Run("prevents race conditions", func(t *testing.T) { - t.Skip() + require.NotNil(t, items) + require.Equal(t, 1, len(items)) + assert.Equal(t, "@tanuki", items[0].Sparklee) + assert.Equal(t, "because", items[0].Reason) }) }) |
