summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-06 03:32:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-06 03:32:28 +0000
commitc7495f996d672c0a132940951fa5d44e2c066a6f (patch)
tree8b6707ce1ec4701769cc0fd6729776aec4a85649 /test
parent9ca160c168abf64695e7ff89beb72c0ce5eed6a6 (diff)
merge revision(s) 34376:
* ext/io/console/console.c (io_getch): default delegating method for StringIO. https://github.com/nobu/io-console/issues/4 * ext/stringio/stringio.c: moved some methods to hidden modules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/io/console/test_io_console.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index b0fcbb7588..9c2fe1ac54 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -4,6 +4,7 @@ begin
require 'pty'
rescue LoadError
end
+require_relative '../../ruby/envutil'
class TestIO_Console < Test::Unit::TestCase
def test_raw
@@ -175,8 +176,6 @@ class TestIO_Console < Test::Unit::TestCase
end if defined?(PTY) and defined?(IO::console)
class TestIO_Console < Test::Unit::TestCase
- require_relative '../../ruby/envutil'
-
case
when Process.respond_to?(:daemon)
noctty = [EnvUtil.rubybin, "-e", "Process.daemon(true)"]
@@ -194,6 +193,7 @@ class TestIO_Console < Test::Unit::TestCase
t2 = Tempfile.new("console")
t2.close
cmd = NOCTTY + [
+ '--disable=gems',
'-rio/console',
'-e', 'open(ARGV[0], "w") {|f| f.puts IO.console.inspect}',
'-e', 'File.unlink(ARGV[1])',
@@ -208,3 +208,11 @@ class TestIO_Console < Test::Unit::TestCase
end
end
end if defined?(IO.console)
+
+class TestIO_Console < Test::Unit::TestCase
+ def test_stringio_getch
+ assert_ruby_status(%w"--disable=gems -rstringio -rio/console", "exit(StringIO.method_defined?(:getch))")
+ assert_ruby_status(%w"--disable=gems -rio/console -rstringio", "exit(StringIO.method_defined?(:getch))")
+ assert_ruby_status(%w"--disable=gems -rstringio", "exit(!StringIO.method_defined?(:getch))")
+ end
+end