From 4b7d27ca0de5e1294fa2072d948953ef49753fc5 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 17 Dec 2019 17:24:21 +0900 Subject: [ruby/io-console] Use IO.console instead of STDIN https://github.com/ruby/io-console/commit/9e3ec5b936 --- test/io/console/test_io_console.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/io') diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 765385df40..083b4a7fb9 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -332,11 +332,12 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do begin; STDOUT.puts `stty -a`.scan(/\b\w+ *= *\^.;/), "" STDOUT.flush - while c = STDIN.getch + con = IO.console + while c = con.getch p c.ord - p STDIN.getch(intr: false).ord + p con.getch(intr: false).ord begin - p STDIN.getch(intr: true).ord + p con.getch(intr: true).ord rescue Interrupt => e p e end -- cgit v1.2.1