Use allow instead of expect to set test state in before() blocks