@@ -108,6 +108,21 @@ func TestFeatureBuilder(t *testing.T) {
108
108
}
109
109
},
110
110
},
111
+ { // nolint
112
+ name : "named setups" ,
113
+ setup : func (t * testing.T ) types.Feature {
114
+ return New ("test" ).WithSetup ("setup-test" , func (ctx context.Context , t * testing.T , config * envconf.Config ) context.Context {
115
+ return ctx
116
+ }).Feature ()
117
+ },
118
+ eval : func (t * testing.T , f types.Feature ) {
119
+ ft := f .(* defaultFeature ) //nolint
120
+ setups := GetStepsByLevel (ft .Steps (), types .LevelSetup )
121
+ if setups [0 ].Name () != "setup-test" {
122
+ t .Errorf ("unexpected setup name: %s" , setups [0 ].Name ())
123
+ }
124
+ },
125
+ },
111
126
{
112
127
name : "one teardown" ,
113
128
setup : func (t * testing.T ) types.Feature {
@@ -149,6 +164,21 @@ func TestFeatureBuilder(t *testing.T) {
149
164
}
150
165
},
151
166
},
167
+ { // nolint
168
+ name : "named teardowns" ,
169
+ setup : func (t * testing.T ) types.Feature {
170
+ return New ("test" ).WithTeardown ("teardown-test" , func (ctx context.Context , t * testing.T , config * envconf.Config ) context.Context {
171
+ return ctx
172
+ }).Feature ()
173
+ },
174
+ eval : func (t * testing.T , f types.Feature ) {
175
+ ft := f .(* defaultFeature ) //nolint
176
+ setups := GetStepsByLevel (ft .Steps (), types .LevelTeardown )
177
+ if setups [0 ].Name () != "teardown-test" {
178
+ t .Errorf ("unexpected teardown name: %s" , setups [0 ].Name ())
179
+ }
180
+ },
181
+ },
152
182
{
153
183
name : "single assessment" ,
154
184
setup : func (t * testing.T ) types.Feature {
@@ -174,7 +204,7 @@ func TestFeatureBuilder(t *testing.T) {
174
204
return New ("test" ).Assess ("some test" , func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
175
205
// test
176
206
return ctx
177
- }).Assess ("some tets 2" , func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
207
+ }).Assess ("some tests 2" , func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
178
208
// test
179
209
return ctx
180
210
}).Feature ()
@@ -196,10 +226,10 @@ func TestFeatureBuilder(t *testing.T) {
196
226
return New ("test" ).Setup (func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
197
227
// test
198
228
return ctx
199
- }).Assess ("some tets 2" , func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
229
+ }).Assess ("some tests 2" , func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
200
230
// test
201
231
return ctx
202
- }).Assess ("some tets 3" , func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
232
+ }).Assess ("some tests 3" , func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
203
233
// test
204
234
return ctx
205
235
}).Teardown (func (ctx context.Context , t * testing.T , _ * envconf.Config ) context.Context {
0 commit comments