From 8b583a013ab3fb70d376cb07e4aba316e830f305 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 5 Oct 2016 07:01:31 +0000 Subject: 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 --- test/ruby/test_io.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/ruby/test_io.rb') 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 -- cgit v1.2.3