In Battle Edit
Vital Spirit prevents the Pokémon from being afflicted by sleep and Yawn. Rest will fail when used by the Pokémon.
A Pokémon with this Ability will wake up if it is asleep in battle (such as if it gains the Ability outside of battle or by an effect like Skill Swap, or is put to sleep by a Pokémon with an Ability like Mold Breaker).
If a Pokémon with this Ability is drowsy due to Yawn, when it would fall asleep the Ability activates and keeps it awake
All this information its from Bulbapedia. ( http://bulbapedia.bulbagarden.net/wiki/Vital_Spirit_(Ability) )