The at_exit function

Traditionally, in functional testing, a clean up/tear down script would be run in something called an After hook. These hooks are part of the Cucumber DSL and are designed to execute when a scenario has finished. Cucumber example: After do |scenario| if scenario.failed? MultiLogger.clean_logs end end There is a drawback to these hooks where they will fail to run when certain exit codes are returned from the scenario or the program is interrupted....

August 23, 2023 · 2 min · 255 words · Thomas Feathers