Skip to content

Commit

Permalink
fix: drop unnecessary file change for unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Eileen-Yu committed Jan 29, 2024
1 parent 0854322 commit fab8f06
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pkg/plugin/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,28 @@ limitations under the License.
package util

import (
"os"
"path/filepath"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

var _ = Describe("InsertCode", func() {
var _ = Describe("InsertCode", Ordered, func() {
path := filepath.Join("testdata", "exampleFile.txt")
var originalContent []byte

BeforeAll(func() {
var err error
originalContent, err = os.ReadFile(path)
Expect(err).NotTo(HaveOccurred())
})

AfterAll(func() {
err := os.WriteFile(path, originalContent, 0644)
Expect(err).NotTo(HaveOccurred())
})

DescribeTable("should not succeed",
func(target string) {
Expect(InsertCode(path, target, "exampleCode")).ShouldNot(Succeed())
Expand Down

0 comments on commit fab8f06

Please sign in to comment.