Refactor assert to expect api