module Sus::Context
def after(&hook)
After hooks are usually invoked in the reverse order they are defined, i.e. the last defined hook is invoked first.
Include an around method to the context class, that invokes the given block after running the test.
def after(&hook) wrapper = Module.new wrapper.define_method(:after) do |error| instance_exec(error, &hook) rescue => error raise ensure super(error) end self.include(wrapper) end