Refactored: .on_dup is a function. Added tests.
before/after should be closed off from other tests.