Skip to content

Commit

Permalink
Skip when unable to set input
Browse files Browse the repository at this point in the history
`Reline::Windows` always reads from the console by Windows API
 using fiddle.
  • Loading branch information
nobu committed Oct 12, 2021
1 parent 30e589b commit c3bf85f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/reline/test_reline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,14 @@ def test_set_input_and_output
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
Expand Down

0 comments on commit c3bf85f

Please sign in to comment.