aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pty.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_pty.rb')
-rw-r--r--test/test_pty.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_pty.rb b/test/test_pty.rb
index 025cafc8f8..80cc02c72e 100644
--- a/test/test_pty.rb
+++ b/test/test_pty.rb
@@ -195,5 +195,16 @@ class TestPTY < Test::Unit::TestCase
assert_nil(st1)
assert_equal(pid, st2.pid)
end
+
+ def test_cloexec
+ PTY.open {|m, s|
+ assert(m.close_on_exec?)
+ assert(s.close_on_exec?)
+ }
+ PTY.spawn(RUBY, '-e', '') {|r, w, pid|
+ assert(r.close_on_exec?)
+ assert(w.close_on_exec?)
+ }
+ end
end if defined? PTY