From b0d2220c8cf715eafa67b35207ff44596260e75b Mon Sep 17 00:00:00 2001 From: Vlad Bokov Date: Fri, 20 May 2022 01:08:30 +0300 Subject: [PATCH] Expose Puma::NullIO#closed? (#2880) --- lib/puma/null_io.rb | 4 ++++ test/test_null_io.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/puma/null_io.rb b/lib/puma/null_io.rb index 71d410c6..70f8fe38 100644 --- a/lib/puma/null_io.rb +++ b/lib/puma/null_io.rb @@ -52,5 +52,9 @@ module Puma def flush self end + + def closed? + true + end end end diff --git a/test/test_null_io.rb b/test/test_null_io.rb index 8a8f034b..c76183a1 100644 --- a/test/test_null_io.rb +++ b/test/test_null_io.rb @@ -64,4 +64,8 @@ class TestNullIO < Minitest::Test def test_flush_returns_self assert_equal nio, nio.flush end + + def test_closed_returns_true + assert_equal true, nio.closed? + end end