module Boty RSpec.describe Logger do class Client; include Logger end let(:logger) { Boty::Logger } let(:client) { Client.new } describe ".adapter" do it "changes the internal logger representation" do memory_logger = Boty::Logger::Memory.new logger.adapter = memory_logger expect(memory_logger).to receive(:info).with "hello" client.logger.info "hello" end end describe Logger::Memory do subject(:adapter) { described_class.new } before do logger.adapter = adapter end it "stores the logs in memory" do client.logger.info "hello" expect(adapter.logs.last).to eq "hello" end end end end