Skip to content

Commit

Permalink
add unit test for jammy stack ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankie Gallina-Jones authored and ForestEckhardt committed Jul 12, 2022
1 parent a0aaa19 commit a5c31ad
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions procfile/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {
})
})

context("tiny stack", func() {
context("bionic tiny stack", func() {
it.Before(func() {
ctx.StackID = libpak.TinyStackID
ctx.StackID = libpak.BionicTinyStackID
})

it("adds metadata to result", func() {
Expand Down Expand Up @@ -176,4 +176,41 @@ func testBuild(t *testing.T, context spec.G, it spec.S) {

})

context("jammy tiny stack", func() {
it.Before(func() {
ctx.StackID = libpak.JammyTinyStackID
})

it("adds metadata to result", func() {
ctx.Plan = libcnb.BuildpackPlan{
Entries: []libcnb.BuildpackPlanEntry{
{
Name: "procfile",
Metadata: map[string]interface{}{
"test-type-1": "test-command-1",
"test-type-2": "test-command-2 argument",
},
},
},
}

result := libcnb.NewBuildResult()
result.Processes = append(result.Processes,
libcnb.Process{
Type: "test-type-1",
Command: "test-command-1",
Arguments: []string{},
Direct: true,
},
libcnb.Process{
Type: "test-type-2",
Command: "test-command-2",
Arguments: []string{"argument"},
Direct: true,
},
)

Expect(build.Build(ctx)).To(Equal(result))
})
})
}

0 comments on commit a5c31ad

Please sign in to comment.