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.
c3bf85f5af
This commit is contained in:
parent
013bac15b0
commit
41db84aa30
1 changed files with 6 additions and 1 deletions
|
@ -280,9 +280,14 @@ class Reline::Test < Reline::TestCase
|
||||||
assert_raise(TypeError) do
|
assert_raise(TypeError) do
|
||||||
Reline.output = "This is not a file."
|
Reline.output = "This is not a file."
|
||||||
end
|
end
|
||||||
|
|
||||||
input, to_write = IO.pipe
|
input, to_write = IO.pipe
|
||||||
to_read, output = 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"
|
to_write.write "a\n"
|
||||||
result = Reline.readline
|
result = Reline.readline
|
||||||
to_write.close
|
to_write.close
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue