diff --git a/Rakefile b/Rakefile index 169d954..db9dd5c 100644 --- a/Rakefile +++ b/Rakefile @@ -48,6 +48,9 @@ task "build" => %w[rdoc:coverage build:java] task "build:java" => "date_epoch" +# For old the RDoc included with Ruby 2.6, which doesn't define this task. +task "rdoc:coverage" + # Keep RDoc::Task's coverage check from exiting the Rake process. coverage_task = Rake::Task["rdoc:coverage"].actions.shift task "rdoc:coverage" do |*t| diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 173e6a2..48743fc 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -211,7 +211,8 @@ def test_noecho s.noecho { assert_not_send([s, :echo?]) m.print "a" - sleep 0.1 + m.flush + assert_equal("a", s.getch) } m.print "b" assert_equal("b", m.readpartial(10)) @@ -309,8 +310,6 @@ def test_console_mode end def test_stty_redirect_stdout - omit unless IO.private_method_defined?(:_io_console_stty) - helper do |_, s| stdout = STDOUT.dup begin @@ -322,7 +321,7 @@ def test_stty_redirect_stdout end assert_not_empty(mode) end - end + end if IO.private_method_defined?(:_io_console_stty) def test_tty_on_pty pend "not supported" unless TTY_ENHANCED