4 expected()

The expected() function stops an execution if a specific class is not expected.

expected(2, 'character')
## Error in expected(2, "character"): Class "character" expected. Received class numeric.