[前][次][番号順一覧][スレッド一覧]

ruby-changes:44276

From: nobu <ko1@a...>
Date: Wed, 5 Oct 2016 16:01:35 +0900 (JST)
Subject: [ruby-changes:44276] nobu:r56349 (trunk): test_io.rb: workaround for Docker

nobu	2016-10-05 16:01:31 +0900 (Wed, 05 Oct 2016)

  New Revision: 56349

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56349

  Log:
    test_io.rb: workaround for Docker
    
    * test/ruby/test_io.rb (test_ioctl_linux2): tty device may not
      work on Docker.

  Modified files:
    trunk/test/ruby/test_io.rb
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 56348)
+++ test/ruby/test_io.rb	(revision 56349)
@@ -2891,13 +2891,19 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2891
 
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]