Generalize hook testing