Skip to content

Commit

Permalink
Merge pull request #383 from nobu/skip-set_input-windows
Browse files Browse the repository at this point in the history
Skip when unable to set input
  • Loading branch information
nobu committed Oct 12, 2021
2 parents 30e589b + c3bf85f commit a045668
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 a045668

Please sign in to comment.