1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Skip when unable to set input

`Reline::Windows` always reads from the console by Windows API
 using fiddle.

https://github.com/ruby/reline/commit/c3bf85f5af
This commit is contained in:
Nobuyoshi Nakada 2021-10-13 02:07:16 +09:00 committed by git
parent 013bac15b0
commit 41db84aa30

View file

@ -280,9 +280,14 @@ class Reline::Test < Reline::TestCase
assert_raise(TypeError) do
Reline.output = "This is not a file."
end
input, to_write = IO.pipe
to_read, output = IO.pipe
Reline.input, Reline.output = input, output
unless Reline.__send__(:input=, input)
omit "Setting to input is not effective on #{Reline::IOGate}"
end
Reline.output = output
to_write.write "a\n"
result = Reline.readline
to_write.close