set NewDigester back
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
This commit is contained in:
parent
374e4ba495
commit
bb4671cc0e
|
@ -59,28 +59,25 @@ func TestWithIndex(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNewDigester(t *testing.T) {
|
func TestNewDigester(t *testing.T) {
|
||||||
g := NewWithT(t)
|
|
||||||
|
|
||||||
t.Run("default", func(t *testing.T) {
|
t.Run("default", func(t *testing.T) {
|
||||||
|
g := NewWithT(t)
|
||||||
|
|
||||||
d := NewDigester()
|
d := NewDigester()
|
||||||
|
|
||||||
g.Expect(d).ToNot(BeNil())
|
g.Expect(d).ToNot(BeNil())
|
||||||
g.Expect(d.index).To(BeEmpty())
|
g.Expect(d.index).ToNot(BeNil())
|
||||||
g.Expect(d.digests).ToNot(BeNil())
|
g.Expect(d.digests).ToNot(BeNil())
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("with index", func(t *testing.T) {
|
t.Run("with index", func(t *testing.T) {
|
||||||
initialIndex := map[string]string{"foo": "bar"}
|
g := NewWithT(t)
|
||||||
d := NewDigester(WithIndex(initialIndex))
|
|
||||||
g.Expect(d).ToNot(BeNil())
|
|
||||||
g.Expect(d.index).To(Equal(initialIndex))
|
|
||||||
g.Expect(d.digests).ToNot(BeNil())
|
|
||||||
})
|
|
||||||
|
|
||||||
t.Run("handles multiple WithIndex options, applying last one", func(t *testing.T) {
|
i := map[string]string{"foo": "bar"}
|
||||||
firstIndex := map[string]string{"a": "b"}
|
d := NewDigester(WithIndex(i))
|
||||||
secondIndex := map[string]string{"c": "d"}
|
|
||||||
d := NewDigester(WithIndex(firstIndex), WithIndex(secondIndex))
|
g.Expect(d).ToNot(BeNil())
|
||||||
g.Expect(d.index).To(Equal(secondIndex))
|
g.Expect(d.index).To(Equal(i))
|
||||||
|
g.Expect(d.digests).ToNot(BeNil())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue