ForEach method for repositories.

This commit is contained in:
Andrey Smirnov
2013-12-19 17:34:13 +04:00
parent ed6265da10
commit 8e08b09aca
2 changed files with 16 additions and 0 deletions
+9
View File
@@ -109,6 +109,15 @@ func (s *RemoteRepoCollectionSuite) TestAddByName(c *C) {
}
func (s *RemoteRepoCollectionSuite) TestForEach(c *C) {
repo, _ := NewRemoteRepo("yandex", "http://mirror.yandex.ru/debian/", "squeeze", []string{"main"}, []string{})
s.collection.Add(repo)
count := 0
s.collection.ForEach(func(*RemoteRepo) { count++ })
c.Assert(count, Equals, 1)
}
const exampleReleaseFile = `Origin: LP-PPA-agenda-developers-daily
Label: Agenda Daily Builds
Suite: precise