summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-11 15:21:09 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-11 15:21:09 +0000
commit3583c42c713ef66f3f112edb26a4301bfa43a68f (patch)
tree72bca24e3a3c49afe8cebbf4b6b5e48039a5097e /test
parent9b0b9ac237c60d34c9cd06538d1a133eed9f7130 (diff)
downloadruby-3583c42c713ef66f3f112edb26a4301bfa43a68f.tar.gz
* test/ruby/test_rubyoptions.rb (test_script_from_stdin): disable
echo. [ruby-dev:41966] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rubyoptions.rb41
1 files changed, 23 insertions, 18 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index d4847e92d5..5cb300991d 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -434,25 +434,30 @@ class TestRubyOptions < Test::Unit::TestCase
end
require 'timeout'
result = nil
- s, w = IO.pipe
- PTY.spawn(EnvUtil.rubybin, out: w) do |r, m|
- w.close
- m.print("\C-d")
- assert_nothing_raised('[ruby-dev:37798]') do
- result = Timeout.timeout(3) {s.read}
- end
- end
- s.close
+ IO.pipe {|r, w|
+ PTY.open {|m, s|
+ m.echo = false
+ m.print("\C-d")
+ pid = spawn(EnvUtil.rubybin, :in => s, :out => w)
+ w.close
+ assert_nothing_raised('[ruby-dev:37798]') do
+ result = Timeout.timeout(3) {r.read}
+ end
+ Process.wait pid
+ }
+ }
assert_equal("", result, '[ruby-dev:37798]')
- s, w = IO.pipe
- PTY.spawn(EnvUtil.rubybin, out: w) do |r, m|
- w.close
- m.print("$stdin.read; p $stdin.gets\n\C-d")
- m.print("abc\n\C-d")
- m.print("zzz\n")
- result = s.read
- end
- s.close
+ IO.pipe {|r, w|
+ PTY.open {|m, s|
+ m.echo = false
+ pid = spawn(EnvUtil.rubybin, :in => s, :out => w)
+ w.close
+ m.print("$stdin.read; p $stdin.gets\n\C-d")
+ m.print("abc\n\C-d")
+ m.print("zzz\n")
+ result = r.read
+ }
+ }
assert_equal("\"zzz\\n\"\n", result, '[ruby-core:30910]')
end
end