Refactor spec for run post install hook.