aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pty.rb
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-24 05:25:55 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-24 05:25:55 +0000
commitaa836e539f154e49587e48791d44f829d239766b (patch)
tree0b5a709e4a4e1bdffe9ed204713e6b0fe2009b84 /test/test_pty.rb
parent9da7920d6b3df25509eef26123edc2502c849a1d (diff)
downloadruby-aa836e539f154e49587e48791d44f829d239766b.tar.gz
* test/test_pty.rb: Same as 229281; existence of PTY class do not
guarantee a successful pty operation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_pty.rb')
-rw-r--r--test/test_pty.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test_pty.rb b/test/test_pty.rb
index dff025686d..6da49a420f 100644
--- a/test/test_pty.rb
+++ b/test/test_pty.rb
@@ -13,6 +13,9 @@ class TestPTY < Test::Unit::TestCase
def test_spawn_without_block
r, w, pid = PTY.spawn(RUBY, '-e', 'puts "a"')
+ rescue RuntimeError
+ skip $!
+ else
assert_equal("a\r\n", r.gets)
ensure
Process.wait pid if pid
@@ -23,6 +26,8 @@ class TestPTY < Test::Unit::TestCase
assert_equal("b\r\n", r.gets)
Process.wait(pid)
}
+ rescue RuntimeError
+ skip $!
end
def test_commandline
@@ -31,6 +36,8 @@ class TestPTY < Test::Unit::TestCase
assert_equal("foo\r\n", r.gets)
Process.wait(pid)
}
+ rescue RuntimeError
+ skip $!
end
def test_argv0
@@ -38,10 +45,15 @@ class TestPTY < Test::Unit::TestCase
assert_equal("bar\r\n", r.gets)
Process.wait(pid)
}
+ rescue RuntimeError
+ skip $!
end
def test_open_without_block
ret = PTY.open
+ rescue RuntimeError
+ skip $!
+ else
assert_kind_of(Array, ret)
assert_equal(2, ret.length)
assert_equal(IO, ret[0].class)
@@ -70,6 +82,9 @@ class TestPTY < Test::Unit::TestCase
assert(File.chardev?(slave.path))
x
}
+ rescue RuntimeError
+ skip $!
+ else
assert(r[0].closed?)
assert(r[1].closed?)
assert_equal(y, x)
@@ -82,6 +97,9 @@ class TestPTY < Test::Unit::TestCase
assert(slave.closed?)
assert(master.closed?)
}
+ rescue RuntimeError
+ skip $!
+ else
assert_nothing_raised {
PTY.open {|master, slave|
slave.close
@@ -97,6 +115,8 @@ class TestPTY < Test::Unit::TestCase
master.puts "bar"
assert_equal("bar", slave.gets.chomp)
}
+ rescue RuntimeError
+ skip $!
end
def test_stat_slave
@@ -105,6 +125,8 @@ class TestPTY < Test::Unit::TestCase
assert_equal(Process.uid, s.uid)
assert_equal(0600, s.mode & 0777)
}
+ rescue RuntimeError
+ skip $!
end
def test_close_master
@@ -112,6 +134,8 @@ class TestPTY < Test::Unit::TestCase
master.close
assert_raise(EOFError) { slave.readpartial(10) }
}
+ rescue RuntimeError
+ skip $!
end
def test_close_slave
@@ -123,6 +147,8 @@ class TestPTY < Test::Unit::TestCase
Errno::EIO # GNU/Linux
) { master.readpartial(10) }
}
+ rescue RuntimeError
+ skip $!
end
def test_getpty_nonexistent