wrote spec for isAlive function