Skip to content

Commit 792cbb6

Browse files
committed
Fix comment
1 parent 2e435cf commit 792cbb6

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

coderd/authzquery/methods_test.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,16 @@ MethodLoop:
142142
}
143143

144144
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+
146146
outputs, err := splitResp(t, resp)
147147
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)
153153
}
154+
154155
found = true
155156
break MethodLoop
156157
}
@@ -236,11 +237,6 @@ func methodCase(ins []reflect.Value, assertions []AssertRBAC, outs []reflect.Val
236237
}
237238
}
238239

239-
func (m MethodCase) Outputs(outs ...any) MethodCase {
240-
m.ExpectedOutputs = values(outs...)
241-
return m
242-
}
243-
244240
// values is a convenience method for creating []reflect.Value.
245241
//
246242
// values(workspace, template, ...)

0 commit comments

Comments
 (0)