diff options
Diffstat (limited to 'storage/memory/storage_test.go')
-rw-r--r-- | storage/memory/storage_test.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/storage/memory/storage_test.go b/storage/memory/storage_test.go index ba7e224..f2fd3da 100644 --- a/storage/memory/storage_test.go +++ b/storage/memory/storage_test.go @@ -25,7 +25,12 @@ func (s *ObjectStorageSuite) TestSet(c *C) { o.SetType(core.CommitObject) o.SetSize(3) - o.Writer().Write([]byte("foo")) + + writer, err := o.Writer() + c.Assert(err, IsNil) + defer func() { c.Assert(writer.Close(), IsNil) }() + + writer.Write([]byte("foo")) h, err := os.Set(o) c.Assert(h.String(), Equals, "bc9968d75e48de59f0870ffb71f5e160bbbdcf52") @@ -39,7 +44,12 @@ func (s *ObjectStorageSuite) TestGet(c *C) { o.SetType(core.CommitObject) o.SetSize(3) - o.Writer().Write([]byte("foo")) + + writer, err := o.Writer() + c.Assert(err, IsNil) + defer func() { c.Assert(writer.Close(), IsNil) }() + + writer.Write([]byte("foo")) h, err := os.Set(o) c.Assert(err, IsNil) |