* test/readline/test_readline.rb (TestReadline::replace_stdio):

merged the patch of [ruby-dev:25232] instead of [ruby-dev:25223].
  (merged from ruby_1_8 branch)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2005-09-22 08:33:05 +00:00
parent 941af27490
commit 759410a8c9
2 changed files with 24 additions and 14 deletions

View File

@ -1,3 +1,9 @@
Thu Sep 22 17:31:48 2005 Shugo Maeda <shugo@ruby-lang.org>
* test/readline/test_readline.rb (TestReadline::replace_stdio):
merged the patch of [ruby-dev:25232] instead of [ruby-dev:25223].
(merged from ruby_1_8 branch)
Wed Sep 21 23:30:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> Wed Sep 21 23:30:44 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (configuration): generalized nmake dependent code. * lib/mkmf.rb (configuration): generalized nmake dependent code.

View File

@ -62,10 +62,12 @@ class TestReadline < Test::Unit::TestCase
private private
def replace_stdio(stdin_path, stdout_path) def replace_stdio(stdin_path, stdout_path)
open(stdin_path, "r"){|stdin|
open(stdout_path, "w"){|stdout|
orig_stdin = STDIN.dup orig_stdin = STDIN.dup
orig_stdout = STDOUT.dup orig_stdout = STDOUT.dup
STDIN.reopen(stdin_path, "r") STDIN.reopen(stdin)
STDOUT.reopen(stdout_path, "w") STDOUT.reopen(stdout)
begin begin
Readline.input = STDIN Readline.input = STDIN
Readline.output = STDOUT Readline.output = STDOUT
@ -76,6 +78,8 @@ class TestReadline < Test::Unit::TestCase
orig_stdin.close orig_stdin.close
orig_stdout.close orig_stdout.close
end end
}
}
end end
end end