Added when method to the mixin
Refactored eventemitter spec