diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-09-04 12:06:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-04 12:06:44 +0200 |
commit | 2f1583896bcc3c182d8165d6aeeb23c771cc5417 (patch) | |
tree | 883c48f088d16ef07c97fdb93888c5947df994f4 /storage/filesystem/storage_test.go | |
parent | 8e76874ae2a3f5029269af76a86f0ee294699df9 (diff) | |
parent | 659ec443b4a975e3adf78f24e59ad69d210d2c0b (diff) | |
download | go-git-2f1583896bcc3c182d8165d6aeeb23c771cc5417.tar.gz |
Merge pull request #941 from jfontan/improvement/static-mode
plumbing/storer: add ExclusiveAccess option to Storer
Diffstat (limited to 'storage/filesystem/storage_test.go')
-rw-r--r-- | storage/filesystem/storage_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/storage/filesystem/storage_test.go b/storage/filesystem/storage_test.go index 4d9ba6f..7f85ef5 100644 --- a/storage/filesystem/storage_test.go +++ b/storage/filesystem/storage_test.go @@ -26,6 +26,10 @@ func (s *StorageSuite) SetUpTest(c *C) { storage, err := NewStorage(osfs.New(s.dir)) c.Assert(err, IsNil) + setUpTest(s, c, storage) +} + +func setUpTest(s *StorageSuite, c *C, storage *Storage) { // ensure that right interfaces are implemented var _ storer.EncodedObjectStorer = storage var _ storer.IndexStorer = storage @@ -51,3 +55,19 @@ func (s *StorageSuite) TestNewStorageShouldNotAddAnyContentsToDir(c *C) { c.Assert(err, IsNil) c.Assert(fis, HasLen, 0) } + +type StorageExclusiveSuite struct { + StorageSuite +} + +var _ = Suite(&StorageExclusiveSuite{}) + +func (s *StorageExclusiveSuite) SetUpTest(c *C) { + s.dir = c.MkDir() + storage, err := NewStorageWithOptions( + osfs.New(s.dir), + Options{ExclusiveAccess: true}) + c.Assert(err, IsNil) + + setUpTest(&s.StorageSuite, c, storage) +} |