lib/cucumber/runtime/user_interface.rb in cucumber-7.1.0 vs lib/cucumber/runtime/user_interface.rb in cucumber-8.0.0.rc.1
- old
+ new
@@ -19,21 +19,22 @@
#
# If that doesn't issue a beep, you can shell out to something else
# that makes a sound before invoking #ask.
#
def ask(question, timeout_seconds)
- STDOUT.puts(question)
- STDOUT.flush
+ $stdout.puts(question)
+ $stdout.flush
puts(question)
answer = if Cucumber::JRUBY
jruby_gets(timeout_seconds)
else
mri_gets(timeout_seconds)
end
raise("Waited for input for #{timeout_seconds} seconds, then timed out.") unless answer
+
puts(answer)
answer
end
# Embed +src+ of MIME type +mime_type+ into the output. The +src+ argument may
@@ -46,19 +47,19 @@
private
def mri_gets(timeout_seconds)
Timeout.timeout(timeout_seconds) do
- STDIN.gets
+ $stdin.gets
end
rescue Timeout::Error
nil
end
def jruby_gets(timeout_seconds)
answer = nil
t = java.lang.Thread.new do
- answer = STDIN.gets
+ answer = $stdin.gets
end
t.start
t.join(timeout_seconds * 1000)
answer
end