File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1- exampleTargetexampleCodeexampleCodeexampleCodeexampleCodeexampleCodeexampleCodeexampleCodeexampleCode
1+ exampleTarget
Original file line number Diff line number Diff line change @@ -14,14 +14,28 @@ limitations under the License.
1414package util
1515
1616import (
17+ "os"
1718 "path/filepath"
1819
1920 . "github.com/onsi/ginkgo/v2"
2021 . "github.com/onsi/gomega"
2122)
2223
23- var _ = Describe ("InsertCode" , func () {
24+ var _ = Describe ("InsertCode" , Ordered , func () {
2425 path := filepath .Join ("testdata" , "exampleFile.txt" )
26+ var originalContent []byte
27+
28+ BeforeAll (func () {
29+ var err error
30+ originalContent , err = os .ReadFile (path )
31+ Expect (err ).NotTo (HaveOccurred ())
32+ })
33+
34+ AfterAll (func () {
35+ err := os .WriteFile (path , originalContent , 0644 )
36+ Expect (err ).NotTo (HaveOccurred ())
37+ })
38+
2539 DescribeTable ("should not succeed" ,
2640 func (target string ) {
2741 Expect (InsertCode (path , target , "exampleCode" )).ShouldNot (Succeed ())
You can’t perform that action at this time.
0 commit comments