Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 drop unnecessary file change for unit test #3757

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/plugin/util/testdata/exampleFile.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
exampleTargetexampleCodeexampleCodeexampleCodeexampleCodeexampleCodeexampleCodeexampleCodeexampleCode
exampleTarget
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
Loading