aboutsummaryrefslogtreecommitdiffstats
path: root/formats/packfile/decoder_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-11-07 20:29:58 +0100
committerGitHub <noreply@github.com>2016-11-07 20:29:58 +0100
commit0ff9ef2b44c53e557c78bde0fd9c29847e5f0e23 (patch)
treeb9c7485fe99e6e89fa736ceb0223aeb2ecddb77c /formats/packfile/decoder_test.go
parentf6ed7424cbf33c7013332d7e95b4262a4bc4a523 (diff)
downloadgo-git-0ff9ef2b44c53e557c78bde0fd9c29847e5f0e23.tar.gz
global storage interface refactor (#112)
* core: ObjectStorage, ReferenceStorage renamed to ObjectStorer and ReferenceStorer * rebase * general, changes request by @alcortes * general, changes request by @alcortes
Diffstat (limited to 'formats/packfile/decoder_test.go')
-rw-r--r--formats/packfile/decoder_test.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/formats/packfile/decoder_test.go b/formats/packfile/decoder_test.go
index 48790b4..aa178d7 100644
--- a/formats/packfile/decoder_test.go
+++ b/formats/packfile/decoder_test.go
@@ -33,7 +33,7 @@ func (s *ReaderSuite) TestDecode(c *C) {
scanner := NewScanner(f.Packfile())
storage := memory.NewStorage()
- d, err := NewDecoder(scanner, storage.ObjectStorage())
+ d, err := NewDecoder(scanner, storage)
c.Assert(err, IsNil)
defer d.Close()
@@ -97,7 +97,7 @@ func (s *ReaderSuite) TestDecodeCRCs(c *C) {
scanner := NewScanner(f.Packfile())
storage := memory.NewStorage()
- d, err := NewDecoder(scanner, storage.ObjectStorage())
+ d, err := NewDecoder(scanner, storage)
c.Assert(err, IsNil)
_, err = d.Decode()
c.Assert(err, IsNil)
@@ -158,11 +158,9 @@ func (s *ReaderSuite) TestSetOffsets(c *C) {
}
func assertObjects(c *C, s *memory.Storage, expects []string) {
- o := s.ObjectStorage().(*memory.ObjectStorage)
-
- c.Assert(len(expects), Equals, len(o.Objects))
+ c.Assert(len(expects), Equals, len(s.Objects))
for _, exp := range expects {
- obt, err := o.Get(core.AnyObject, core.NewHash(exp))
+ obt, err := s.Object(core.AnyObject, core.NewHash(exp))
c.Assert(err, IsNil)
c.Assert(obt.Hash().String(), Equals, exp)
}