correct and simplify noisy test

correct and simplify noisy test

diff --git a/test/client_test.rb b/test/client_test.rb
index 774a1db..91450ae 100644
--- a/test/client_test.rb
+++ b/test/client_test.rb
@@ -53,14 +53,15 @@ class PrometheusExporterTest < Minitest::Test
   end
 
   def test_overriding_logger
-    mock_logger = Minitest::Mock.new
-    mock_logger.expect :level=, nil, [Logger::WARN]
-    mock_logger.expect :warn, nil, ["Prometheus Exporter client is dropping message cause queue is full"]
 
-    client = PrometheusExporter::Client.new(logger: mock_logger, max_queue_size: 1)
+    logs = StringIO.new
+    logger = Logger.new(logs)
+    logger.level = :warn
+
+    client = PrometheusExporter::Client.new(logger: logger, max_queue_size: 1)
     client.send("put a message in the queue")
     client.send("put a second message in the queue to trigger the logger")
 
-    mock_logger.verify
+    assert_includes(logs.string, "dropping message cause queue is full")
   end
 end

GitHub sha: ac2084b074967bbfe1e60ca1da5429d844fce560