Added tests for before/after hooks