Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eof? method to NullIO? #1169

Merged
merged 2 commits into from Dec 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/puma/null_io.rb
Expand Up @@ -26,6 +26,10 @@ def size
0
end

def eof?
true
end

def sync=(v)
end

Expand Down
4 changes: 4 additions & 0 deletions test/test_null_io.rb
Expand Up @@ -9,6 +9,10 @@ def setup
self.nio = Puma::NullIO.new
end

def test_eof_returns_true
assert nio.eof?
end

def test_gets_returns_nil
assert_nil nio.gets
end
Expand Down