1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Add #flush and #sync methods to Puma::NullIO (#2553)

This commit is contained in:
Olivier Bellone 2021-02-10 14:30:24 -08:00 committed by GitHub
parent 26776c86df
commit 7c91d90a11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View file

@ -1,3 +1,8 @@
## 5.2.2 / 2021-02-
* Bugfixes
* Add `#flush` and `#sync` methods to `Puma::NullIO` ([#2553])
## 5.2.1 / 2021-02-05
* Bugfixes

View file

@ -36,6 +36,10 @@ module Puma
true
end
def sync
true
end
def sync=(v)
end
@ -44,5 +48,9 @@ module Puma
def write(*ary)
end
def flush
self
end
end
end

View file

@ -97,6 +97,14 @@ class TestEvents < Minitest::Test
assert_equal "ready\n", out
end
def test_null_log_does_nothing
out, _ = capture_io do
Puma::Events.null.log("ready")
end
assert_equal "", out
end
def test_write_writes_to_stdout
out, _ = capture_io do
Puma::Events.stdio.write("ready")

View file

@ -56,4 +56,12 @@ class TestNullIO < Minitest::Test
def test_size
assert_equal 0, nio.size
end
def test_sync_returns_true
assert_equal true, nio.sync
end
def test_flush_returns_self
assert_equal nio, nio.flush
end
end