File tree Expand file tree Collapse file tree 3 files changed +43
-5
lines changed Expand file tree Collapse file tree 3 files changed +43
-5
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2024 The Kubernetes Authors.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ package util
18
+
19
+ import (
20
+ "testing"
21
+
22
+ . "github.com/onsi/ginkgo/v2"
23
+ . "github.com/onsi/gomega"
24
+ )
25
+
26
+ func TestStage (t * testing.T ) {
27
+ RegisterFailHandler (Fail )
28
+ RunSpecs (t , "Utils Suite" )
29
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -23,16 +23,26 @@ import (
23
23
24
24
var _ = Describe ("InsertCode" , Ordered , func () {
25
25
path := filepath .Join ("testdata" , "exampleFile.txt" )
26
- var originalContent []byte
26
+ var content []byte
27
27
28
28
BeforeAll (func () {
29
- var err error
30
- originalContent , err = os .ReadFile (path )
29
+ err := os .MkdirAll ("testdata" , 0755 )
30
+ Expect (err ).NotTo (HaveOccurred ())
31
+
32
+ if _ , err := os .Stat (path ); os .IsNotExist (err ) {
33
+ err = os .WriteFile (path , []byte ("exampleTarget" ), 0644 )
34
+ Expect (err ).NotTo (HaveOccurred ())
35
+ }
36
+
37
+ content , err = os .ReadFile (path )
31
38
Expect (err ).NotTo (HaveOccurred ())
32
39
})
33
40
34
41
AfterAll (func () {
35
- err := os .WriteFile (path , originalContent , 0644 )
42
+ err := os .WriteFile (path , content , 0644 )
43
+ Expect (err ).NotTo (HaveOccurred ())
44
+
45
+ err = os .RemoveAll ("testdata" )
36
46
Expect (err ).NotTo (HaveOccurred ())
37
47
})
38
48
You can’t perform that action at this time.
0 commit comments