Skip to content

Commit

Permalink
Use matchers.BeAFileMatching
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuatcasey authored and ryanmoran committed Sep 21, 2022
1 parent d639fab commit 41ec9e6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"

"github.com/paketo-buildpacks/occam"
"github.com/paketo-buildpacks/occam/matchers"
"github.com/sclevine/spec"

. "github.com/onsi/gomega"
Expand Down Expand Up @@ -39,13 +40,8 @@ func testSource(t *testing.T, context spec.G, it spec.S) {
Expect(err).NotTo(HaveOccurred())
Expect(destination).To(BeADirectory())

content, err := os.ReadFile(filepath.Join(destination, "some-file"))
Expect(err).NotTo(HaveOccurred())
Expect(string(content)).To(Equal("some-content"))

content, err = os.ReadFile(filepath.Join(destination, ".occam-key"))
Expect(err).NotTo(HaveOccurred())
Expect(content).To(HaveLen(32))
Expect(filepath.Join(destination, "some-file")).To(matchers.BeAFileMatching("some-content"))
Expect(filepath.Join(destination, ".occam-key")).To(matchers.BeAFileMatching(HaveLen(32)))
})

context("failure cases", func() {
Expand Down

0 comments on commit 41ec9e6

Please sign in to comment.