Sync io-console gem.

This commit is contained in:
Samuel Williams 2021-12-29 13:27:40 +13:00
parent 38a3965dea
commit f27eb8148f
No known key found for this signature in database
GPG key ID: A0765423A44728FB
2 changed files with 14 additions and 2 deletions

View file

@ -407,6 +407,10 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
assert_equal(["true"], run_pty("IO.console(:close); p IO.console(:tty?)"))
end
def test_console_kw
assert_equal(["File"], run_pty("IO.console.close; p IO.console(:clone, freeze: true).class"))
end
def test_sync
assert_equal(["true"], run_pty("p IO.console.sync"))
end
@ -483,6 +487,10 @@ defined?(IO.console) and TestIO_Console.class_eval do
IO.console(:close)
end
def test_console_kw
assert_kind_of(IO, IO.console(:clone, freeze: true))
end
def test_sync
assert(IO.console.sync, "console should be unbuffered")
ensure