Skip to content

Commit 07f42bb

Browse files
committed
Add unit tests for AddBuildpackToLayersMD
Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>
1 parent ca4764d commit 07f42bb

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

internal/dist/dist_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,18 @@ func testDist(t *testing.T, when spec.G, it spec.S) {
8686
})
8787
})
8888
})
89+
when("Add", func() {
90+
when("a new buildpack is added", func() {
91+
it("succeeds", func() {
92+
layers := dist.BuildpackLayers{}
93+
apiVersion, _ := api.NewVersion("0.0")
94+
descriptor := dist.BuildpackDescriptor{API: apiVersion, Info: dist.BuildpackInfo{ID: "test", Name: "test", Version: "1.0"}}
95+
dist.AddBuildpackToLayersMD(layers, descriptor, "")
96+
layerInfo, ok := layers.Get(descriptor.Info.ID, descriptor.Info.Version)
97+
h.AssertEq(t, ok, true)
98+
h.AssertEq(t, layerInfo.Name, descriptor.Info.Name)
99+
})
100+
})
101+
})
89102
})
90103
}

0 commit comments

Comments
 (0)