diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-05 07:01:31 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-05 07:01:31 +0000 |
commit | e77c8834ceabc1b173036a400bb5a6e83a28a384 (patch) | |
tree | 9be94f185f9a613892b4b9096559f7d2f326e21e /test | |
parent | 37710da6f9cdccbb5f9536e0332096d8c2347c2e (diff) | |
download | ruby-e77c8834ceabc1b173036a400bb5a6e83a28a384.tar.gz |
test_io.rb: workaround for Docker
* test/ruby/test_io.rb (test_ioctl_linux2): tty device may not
work on Docker.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 505525d95e..99ccf7e9d6 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2891,13 +2891,19 @@ End def test_ioctl_linux2 return unless STDIN.tty? # stdin is not a terminal - File.open('/dev/tty') { |f| + begin + f = File.open('/dev/tty') + rescue Errno::ENOENT, Errno::ENXIO => e + skip e.message + else tiocgwinsz=0x5413 winsize="" assert_nothing_raised { f.ioctl(tiocgwinsz, winsize) } - } + ensure + f.close if f + end end if /^(?:i.?86|x86_64)-linux/ =~ RUBY_PLATFORM def test_setpos |