File tree 4 files changed +7
-13
lines changed
4 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ linters:
57
57
settings :
58
58
interfacebloat :
59
59
# Default is 10
60
- max : 13
60
+ max : 20
61
61
revive :
62
62
enable-all-rules : true
63
63
rules :
Original file line number Diff line number Diff line change @@ -131,6 +131,10 @@ func (gc *GenericCommand) Feed(r io.Reader) {
131
131
gc .cmd .Feed (r )
132
132
}
133
133
134
+ func (gc * GenericCommand ) Setenv (key , value string ) {
135
+ gc .cmd .Env [key ] = value
136
+ }
137
+
134
138
func (gc * GenericCommand ) WithFeeder (fun func () io.Reader ) {
135
139
gc .cmd .WithFeeder (fun )
136
140
}
Original file line number Diff line number Diff line change @@ -34,18 +34,6 @@ const (
34
34
identifierSignatureLength = 8
35
35
)
36
36
37
- // WithFile returns a Data object with a specific temporary file created.
38
- func WithFile (name , content string ) Data {
39
- dat := & data {
40
- labels : & labels {},
41
- temp : & temp {},
42
- }
43
-
44
- dat .temp .Save (content , name )
45
-
46
- return dat
47
- }
48
-
49
37
// WithLabels returns a Data object with specific key value labels set.
50
38
func WithLabels (in map [string ]string ) Data {
51
39
dat := & data {
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ type TestableCommand interface {
111
111
WithCwd (path string )
112
112
// WithTimeout defines the execution timeout for a command.
113
113
WithTimeout (timeout time.Duration )
114
+ // Setenv allows to override a specific env variable directly for a specific command instead of test-wide
115
+ Setenv (key , value string )
114
116
// WithFeeder allows passing a reader to be fed to the command stdin.
115
117
WithFeeder (fun func () io.Reader )
116
118
// Feed allows passing a reader to be fed to the command stdin.
You can’t perform that action at this time.
0 commit comments