@@ -142,15 +142,16 @@ MethodLoop:
142
142
}
143
143
144
144
resp := reflect .ValueOf (az ).Method (i ).Call (append ([]reflect.Value {reflect .ValueOf (ctx )}, testCase .Inputs ... ))
145
- // TODO: Should we assert the object returned is the correct one?
145
+
146
146
outputs , err := splitResp (t , resp )
147
147
require .NoError (t , err , "method %q returned an error" , testName )
148
- if testCase . ExpectedOutputs != nil {
149
- require . Equal ( t , len ( testCase . ExpectedOutputs ), len ( outputs ), "method %q returned unexpected number of outputs" , testName )
150
- for i := range outputs {
151
- require . Equal ( t , testCase . ExpectedOutputs [ i ]. Interface (), outputs [ i ]. Interface (), "method %q returned unexpected output %d" , testName , i )
152
- }
148
+
149
+ // Also assert the required outputs
150
+ require . Equal ( t , len ( testCase . ExpectedOutputs ), len ( outputs ), "method %q returned unexpected number of outputs" , testName )
151
+ for i := range outputs {
152
+ require . Equal ( t , testCase . ExpectedOutputs [ i ]. Interface (), outputs [ i ]. Interface (), "method %q returned unexpected output %d" , testName , i )
153
153
}
154
+
154
155
found = true
155
156
break MethodLoop
156
157
}
@@ -236,11 +237,6 @@ func methodCase(ins []reflect.Value, assertions []AssertRBAC, outs []reflect.Val
236
237
}
237
238
}
238
239
239
- func (m MethodCase ) Outputs (outs ... any ) MethodCase {
240
- m .ExpectedOutputs = values (outs ... )
241
- return m
242
- }
243
-
244
240
// values is a convenience method for creating []reflect.Value.
245
241
//
246
242
// values(workspace, template, ...)
0 commit comments