summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStan Lo <stan001212@gmail.com>2023-05-19 04:00:29 +0900
committergit <svn-admin@ruby-lang.org>2023-05-18 19:00:33 +0000
commitcfb79973537e081da0ab1aa828883524716efe72 (patch)
tree93b551c71fa08320b7ec76c964f6b32f82ef15a7 /test
parentd74b32db9d1e0234b17e4645d270394f7b657f85 (diff)
[ruby/irb] Refactor RubyLex's input/io methods
(https://github.com/ruby/irb/pull/583) 1. Make `RubyLex#set_input` simply assign the input block. This matches the behavior of `RubyLex#set_prompt`. 2. Merge `RubyLex#set_input`'s IO configuration logic with `#set_auto_indent` into `#configure_io`.
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_ruby_lex.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb
index 5188009eee..5413fe51a8 100644
--- a/test/irb/test_ruby_lex.rb
+++ b/test/irb/test_ruby_lex.rb
@@ -41,8 +41,8 @@ module TestIRB
ruby_lex = RubyLex.new(context)
mock_io = MockIO_AutoIndent.new(lines, last_line_index, byte_pointer, add_new_line)
- ruby_lex.set_input(mock_io)
- ruby_lex.set_auto_indent
+ ruby_lex.set_input { @io.gets }
+ ruby_lex.configure_io(mock_io)
mock_io.calculated_indent
end
@@ -99,7 +99,7 @@ module TestIRB
ruby_lex = RubyLex.new(context)
io = proc{ lines.join("\n") }
- ruby_lex.set_input(io) do
+ ruby_lex.set_input do
lines.join("\n")
end
ruby_lex.lex
@@ -658,7 +658,7 @@ module TestIRB
ruby_lex.set_prompt do |ltype, indent, continue, line_no|
'%03d:%01d:%1s:%s ' % [line_no, indent, ltype, continue ? '*' : '>']
end
- ruby_lex.set_input(io)
+ ruby_lex.set_input { @io.gets }
end
def test_dyanmic_prompt