module LoggerSupport def self.included(base) base.instance_eval do let(:logger) { Boty::Logger.adapter } before do change_to_memory_adapter end around(&:run) after do Boty::Logger.adapter = @adapter end end end private def change_to_memory_adapter @adapter = Boty::Logger.adapter Boty::Logger.adapter = Boty::Logger::Memory.new end end