summaryrefslogtreecommitdiff
path: root/test/io/console/test_io_console.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/io/console/test_io_console.rb')
-rw-r--r--test/io/console/test_io_console.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index 3420248415..05ab1a353e 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -19,6 +19,21 @@ class TestIO_Console < Test::Unit::TestCase
}
end
+ def test_cooked
+ helper {|m, s|
+ s.raw {
+ s.print "abc\n"
+ assert_equal("abc\n", m.gets)
+ s.cooked {
+ s.print "def\n"
+ assert_equal("def\r\n", m.gets)
+ }
+ }
+ s.print "ghi\n"
+ assert_equal("ghi\r\n", m.gets)
+ }
+ end
+
def test_echo
helper {|m, s|
assert(s.echo?)