* 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:
parent
941af27490
commit
759410a8c9
@ -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.
|
||||||
|
@ -62,20 +62,24 @@ class TestReadline < Test::Unit::TestCase
|
|||||||
private
|
private
|
||||||
|
|
||||||
def replace_stdio(stdin_path, stdout_path)
|
def replace_stdio(stdin_path, stdout_path)
|
||||||
orig_stdin = STDIN.dup
|
open(stdin_path, "r"){|stdin|
|
||||||
orig_stdout = STDOUT.dup
|
open(stdout_path, "w"){|stdout|
|
||||||
STDIN.reopen(stdin_path, "r")
|
orig_stdin = STDIN.dup
|
||||||
STDOUT.reopen(stdout_path, "w")
|
orig_stdout = STDOUT.dup
|
||||||
begin
|
STDIN.reopen(stdin)
|
||||||
Readline.input = STDIN
|
STDOUT.reopen(stdout)
|
||||||
Readline.output = STDOUT
|
begin
|
||||||
yield
|
Readline.input = STDIN
|
||||||
ensure
|
Readline.output = STDOUT
|
||||||
STDIN.reopen(orig_stdin)
|
yield
|
||||||
STDOUT.reopen(orig_stdout)
|
ensure
|
||||||
orig_stdin.close
|
STDIN.reopen(orig_stdin)
|
||||||
orig_stdout.close
|
STDOUT.reopen(orig_stdout)
|
||||||
end
|
orig_stdin.close
|
||||||
|
orig_stdout.close
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user