mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/io-console] Use omit instead of skip
This test runs with test/unit now, which defines omit instead of
skip.
bd731d0b8d
This commit is contained in:
parent
2a764fe764
commit
a1cc044ea1
1 changed files with 4 additions and 4 deletions
|
@ -35,7 +35,7 @@ class TestIO_Console < Test::Unit::TestCase
|
||||||
Errno.const_get(e) if Errno.const_defined?(e)
|
Errno.const_get(e) if Errno.const_defined?(e)
|
||||||
}
|
}
|
||||||
exceptions.compact!
|
exceptions.compact!
|
||||||
skip if exceptions.empty?
|
omit if exceptions.empty?
|
||||||
File.open(IO::NULL) do |f|
|
File.open(IO::NULL) do |f|
|
||||||
e = assert_raise(*exceptions) do
|
e = assert_raise(*exceptions) do
|
||||||
f.echo?
|
f.echo?
|
||||||
|
@ -226,7 +226,7 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_getpass
|
def test_getpass
|
||||||
skip unless IO.method_defined?("getpass")
|
omit unless IO.method_defined?("getpass")
|
||||||
run_pty("p IO.console.getpass('> ')") do |r, w|
|
run_pty("p IO.console.getpass('> ')") do |r, w|
|
||||||
assert_equal("> ", r.readpartial(10))
|
assert_equal("> ", r.readpartial(10))
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
@ -412,7 +412,7 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
|
||||||
def helper
|
def helper
|
||||||
m, s = PTY.open
|
m, s = PTY.open
|
||||||
rescue RuntimeError
|
rescue RuntimeError
|
||||||
skip $!
|
omit $!
|
||||||
else
|
else
|
||||||
yield m, s
|
yield m, s
|
||||||
ensure
|
ensure
|
||||||
|
@ -423,7 +423,7 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
|
||||||
def run_pty(src, n = 1)
|
def run_pty(src, n = 1)
|
||||||
r, w, pid = PTY.spawn(EnvUtil.rubybin, "-I#{TestIO_Console::PATHS.join(File::PATH_SEPARATOR)}", "-rio/console", "-e", src)
|
r, w, pid = PTY.spawn(EnvUtil.rubybin, "-I#{TestIO_Console::PATHS.join(File::PATH_SEPARATOR)}", "-rio/console", "-e", src)
|
||||||
rescue RuntimeError
|
rescue RuntimeError
|
||||||
skip $!
|
omit $!
|
||||||
else
|
else
|
||||||
if block_given?
|
if block_given?
|
||||||
yield r, w, pid
|
yield r, w, pid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue