diff options
Diffstat (limited to 'references_test.go')
-rw-r--r-- | references_test.go | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/references_test.go b/references_test.go index f5a2fdc..2147f49 100644 --- a/references_test.go +++ b/references_test.go @@ -286,17 +286,11 @@ var referencesTests = [...]struct { */ } -func (s *ReferencesSuite) SetUpSuite(c *C) { - s.BaseSuite.SetUpSuite(c) - s.buildRepositories(c, fixtures.All().ByTag("packfile")) -} - func (s *ReferencesSuite) TestRevList(c *C) { for _, t := range referencesTests { - repo, ok := s.Repositories[t.repo] - c.Assert(ok, Equals, true) + r := s.NewRepositoryFromPackfile(fixtures.ByURL(t.repo).One()) - commit, err := repo.Commit(plumbing.NewHash(t.commit)) + commit, err := r.Commit(plumbing.NewHash(t.commit)) c.Assert(err, IsNil) revs, err := commit.References(t.path) @@ -305,7 +299,7 @@ func (s *ReferencesSuite) TestRevList(c *C) { for i := range revs { if revs[i].Hash.String() != t.revs[i] { - commit, err := repo.Commit(plumbing.NewHash(t.revs[i])) + commit, err := s.Repository.Commit(plumbing.NewHash(t.revs[i])) c.Assert(err, IsNil) equiv, err := equivalent(t.path, revs[i], commit) c.Assert(err, IsNil) @@ -358,14 +352,16 @@ func (s *ReferencesSuite) TestEquivalent(c *C) { } // returns the commits from a slice of hashes -func (s *ReferencesSuite) commits(cc *C, repo string, hs ...string) []*Commit { - r, ok := s.Repositories[repo] - cc.Assert(ok, Equals, true) +func (s *ReferencesSuite) commits(c *C, repo string, hs ...string) []*Commit { + r := s.NewRepositoryFromPackfile(fixtures.ByURL(repo).One()) + result := make([]*Commit, 0, len(hs)) for _, h := range hs { - c, err := r.Commit(plumbing.NewHash(h)) - cc.Assert(err, IsNil) - result = append(result, c) + commit, err := r.Commit(plumbing.NewHash(h)) + c.Assert(err, IsNil) + + result = append(result, commit) } + return result } |