diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-16 00:08:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-16 00:08:56 +0000 |
commit | bc46dfd281a7c5f8ae41517e9bd571e4a4b1d3a0 (patch) | |
tree | 0e83c857127067c3873096d014735b8edd7ae97b /test/io/console | |
parent | ea11cf5d7f902609912652ad74586334638b4945 (diff) |
* test/io/console/test_io_console.rb (TestIO_Console#test_sync):
fix for daemon process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/io/console')
-rw-r--r-- | test/io/console/test_io_console.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 594553bbe6..a0f88b6f8b 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -148,9 +148,17 @@ class TestIO_Console < Test::Unit::TestCase } end - def test_sync - skip "Can't get console (because of there is no tty?)" unless IO.console - assert(helper {IO.console.sync}, "console should be unbuffered") + if IO.console + def test_sync + assert(IO.console.sync, "console should be unbuffered") + end + else + def test_sync + r, w, pid = PTY.spawn(EnvUtil.rubybin, "-rio/console", "-e", "p IO.console.class") + con = r.gets.chomp + Process.wait(pid) + assert_match("File", con) + end end private |