Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/io/console/test_io_console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ def assert_ctrl(expect, cc, r, w)
w.print cc
w.flush
result = EnvUtil.timeout(3) {r.gets}
result = yield result if defined?(yield)
assert_equal(expect, result.chomp)
end

Expand Down Expand Up @@ -404,7 +405,7 @@ def test_intr
if cc = ctrl["intr"]
assert_ctrl("#{cc.ord}", cc, r, w)
assert_ctrl("#{cc.ord}", cc, r, w)
assert_ctrl("Interrupt", cc, r, w) unless /linux/ =~ RUBY_PLATFORM
assert_ctrl("Interrupt", cc, r, w) {|res| res.sub("^C", "")} unless /linux/ =~ RUBY_PLATFORM
end
if cc = ctrl["dsusp"]
assert_ctrl("#{cc.ord}", cc, r, w)
Expand Down Expand Up @@ -542,9 +543,7 @@ def test_ttyname
File.open(ttyname) {|f| assert_predicate(f, :tty?)}
end
end
end

defined?(IO.console) and TestIO_Console.class_eval do
case
when Process.respond_to?(:daemon)
noctty = [EnvUtil.rubybin, "-e", "Process.daemon(true)"]
Expand Down