Refactor CLI tests to use custom assertion.