Unverified Commit 3e59f25e authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4208 from shuujii/io-skip-tty-test

io: Skip TTY test for environments that TTY device is unavailable.
parents 4ffc2803 ff0ab552
...@@ -344,15 +344,21 @@ end ...@@ -344,15 +344,21 @@ end
assert('IO#isatty') do assert('IO#isatty') do
skip "isatty is not supported on this platform" if MRubyIOTestUtil.win? skip "isatty is not supported on this platform" if MRubyIOTestUtil.win?
f1 = File.open("/dev/tty") begin
f2 = File.open($mrbtest_io_rfname) f = File.open("/dev/tty")
rescue RuntimeError => e
assert_true f1.isatty skip e.message
assert_false f2.isatty else
assert_true f.isatty
f1.close ensure
f2.close f&.close
true end
begin
f = File.open($mrbtest_io_rfname)
assert_false f.isatty
ensure
f&.close
end
end end
assert('IO#pos=, IO#seek') do assert('IO#pos=, IO#seek') do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment