Skip to content

Commit

Permalink
add config tests
Browse files Browse the repository at this point in the history
Signed-off-by: Darshan Kumar <itsdarshankumar@gmail.com>
  • Loading branch information
itsdarshankumar committed Mar 17, 2023
1 parent 4efe830 commit 747d127
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions buildpackage/config_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/sclevine/spec/report"

"github.com/buildpacks/pack/buildpackage"
"github.com/buildpacks/pack/pkg/dist"
h "github.com/buildpacks/pack/testhelpers"
)

Expand All @@ -33,6 +34,34 @@ func testBuildpackageConfigReader(t *testing.T, when spec.G, it spec.S) {
os.RemoveAll(tmpDir)
})

it("returns default buildpack config", func() {
expected := buildpackage.Config{
Buildpack: dist.BuildpackURI{
URI: ".",
},
Platform: dist.Platform{
OS: "linux",
},
}
actual := buildpackage.DefaultConfig()

h.AssertEq(t, actual, expected)
})

it("returns default extension config", func() {
expected := buildpackage.Config{
Extension: dist.BuildpackURI{
URI: ".",
},
Platform: dist.Platform{
OS: "linux",
},
}
actual := buildpackage.DefaultExtensionConfig()

h.AssertEq(t, actual, expected)
})

it("returns correct config when provided toml file is valid", func() {
configFile := filepath.Join(tmpDir, "package.toml")

Expand Down

0 comments on commit 747d127

Please sign in to comment.