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

ruby-changes:42514

From: nobu <ko1@a...>
Date: Fri, 15 Apr 2016 09:10:13 +0900 (JST)
Subject: [ruby-changes:42514] nobu:r54588 (trunk): io/console: move conditions

nobu	2016-04-15 10:06:49 +0900 (Fri, 15 Apr 2016)

  New Revision: 54588

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

  Log:
    io/console: move conditions
    
    * test/io/console/test_io_console.rb: move conditions for method
      definitions before the bodies.

  Modified files:
    trunk/test/io/console/test_io_console.rb
Index: test/io/console/test_io_console.rb
===================================================================
--- test/io/console/test_io_console.rb	(revision 54587)
+++ test/io/console/test_io_console.rb	(revision 54588)
@@ -7,6 +7,9 @@ rescue LoadError https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L7
 end
 
 class TestIO_Console < Test::Unit::TestCase
+end
+
+defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
   Bug6116 = '[ruby-dev:45309]'
 
   def test_raw
@@ -294,9 +297,9 @@ class TestIO_Console < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L297
     w.close if w
     Process.wait(pid) if pid
   end
-end if defined?(PTY) and defined?(IO::console)
+end
 
-class TestIO_Console < Test::Unit::TestCase
+defined?(IO.console) and TestIO_Console.class_eval do
   case
   when Process.respond_to?(:daemon)
     noctty = [EnvUtil.rubybin, "-e", "Process.daemon(true)"]
@@ -335,9 +338,9 @@ class TestIO_Console < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L338
       t2.close!
     end
   end
-end if defined?(IO.console)
+end
 
-class TestIO_Console < Test::Unit::TestCase
+TestIO_Console.class_eval do
   def test_stringio_getch
     assert_separately %w"--disable=gems -rstringio -rio/console", %q{
       assert_operator(StringIO, :method_defined?, :getch)

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

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