Example #1
0
				Size: size[id],
			}, nil
		}

		fakeCake.IsLeafStub = func(id layercake.ID) (bool, error) {
			for _, p := range child2parent {
				if p == id {
					return false, nil
				}
			}

			return true, nil
		}

		fakeCake.RemoveStub = func(id layercake.ID) error {
			delete(child2parent, id)
			return nil
		}

		child2parent = make(map[layercake.ID]layercake.ID)
		size = make(map[layercake.ID]int64)
	})

	JustBeforeEach(func() {
		gc = cleaner.NewOvenCleaner(
			retainer,
			fakeThreshold,
		)
	})

	Context("when the threshold is exceeded", func() {
		BeforeEach(func() {