Using expect.fail to create error message instead of explicitly throwing an exception