MCPcopy Index your code
hub / github.com/coder/coder / expectBuild

Function expectBuild

coderd/wsbuilder/wsbuilder_test.go:1560–1573  ·  view source on GitHub ↗

expectBuild captures a call to InsertWorkspaceBuild and runs the provided assertions against it.

(
	assertions func(job database.InsertWorkspaceBuildParams),
)

Source from the content-addressed store, hash-verified

1558// expectBuild captures a call to InsertWorkspaceBuild and runs the provided assertions
1559// against it.
1560func expectBuild(
1561 assertions func(job database.InsertWorkspaceBuildParams),
1562) func(mTx *dbmock.MockStore) {
1563 return func(mTx *dbmock.MockStore) {
1564 mTx.EXPECT().InsertWorkspaceBuild(gomock.Any(), gomock.Any()).
1565 Times(1).
1566 DoAndReturn(
1567 func(ctx context.Context, params database.InsertWorkspaceBuildParams) error {
1568 assertions(params)
1569 return nil
1570 },
1571 )
1572 }
1573}
1574
1575// expectBuildParameters captures a call to InsertWorkspaceBuildParameters and runs the provided assertions
1576// against it.

Calls 2

InsertWorkspaceBuildMethod · 0.65
EXPECTMethod · 0.45

Tested by

no test coverage detected