Skip to content

Commit

Permalink
assert error strings
Browse files Browse the repository at this point in the history
  • Loading branch information
unnatiagg committed Oct 1, 2024
1 parent 2f0dbf4 commit 7c9a439
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/v1alpha2/linodecluster_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ func TestValidateLinodeCluster(t *testing.T) {
},
},
}
validator = &linodeClusterValidator{}
validator = &linodeClusterValidator{}
expectedErrorSubString = "spec.region: Not found: \"example\""
)

NewSuite(t, mock.MockLinodeClient{}).Run(
Expand All @@ -80,7 +81,7 @@ func TestValidateLinodeCluster(t *testing.T) {
Result("error", func(ctx context.Context, mck Mock) {
errs := validator.validateLinodeClusterSpec(ctx, mck.LinodeClient, cluster.Spec)
for _, err := range errs {
require.Error(t, err)
assert.ErrorContains(t, err, expectedErrorSubString)
}
}),
)
Expand Down

0 comments on commit 7c9a439

Please sign in to comment.