From caaf4f2aea6a63be691ced359c4ad85781fb60b8 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 15 Apr 2016 01:06:49 +0000 Subject: io/console: move conditions * test/io/console/test_io_console.rb: move conditions for method definitions before the bodies. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/io/console/test_io_console.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 36619cebd5..4876843555 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -7,6 +7,9 @@ rescue LoadError 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::TestCase 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::TestCase 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) -- cgit v1.2.3