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:
parent
26776c86df
commit
7c91d90a11
4 changed files with 29 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue