aboutsummaryrefslogtreecommitdiffstats
path: root/test/irb/test_context.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/irb/test_context.rb')
-rw-r--r--test/irb/test_context.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb
index 1faf2b373d..75e47cf1e9 100644
--- a/test/irb/test_context.rb
+++ b/test/irb/test_context.rb
@@ -7,16 +7,16 @@ require 'rubygems' if defined?(Gem)
module TestIRB
class TestContext < Test::Unit::TestCase
class TestInputMethod < ::IRB::InputMethod
- attr_reader :line, :line_no
+ attr_reader :list, :line_no
def initialize(list = [])
super("test")
@line_no = 0
- @line = list
+ @list = list
end
def gets
- @list[@line_no.tap {@line_no += 1}]
+ @list[@line_no]&.tap {@line_no += 1}
end
def eof?