Refactor expectAssert, introduce expectDeprecation