diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-12 09:09:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-12 09:09:23 +0000 |
commit | 4969fb6282b2cfdc30c57a5a47aec40ba26c5b00 (patch) | |
tree | 15010b6292b1c1af21f9bb29d57627126f1a077f /test/irb | |
parent | 97c07d3487aac92f72469d0f955eda12c851e87f (diff) | |
download | ruby-4969fb6282b2cfdc30c57a5a47aec40ba26c5b00.tar.gz |
fix TestInputMethod
* test/irb/test_context.rb (TestInputMethod#initialize): fix typos
and increment `line_no` only when not reaching the end.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/irb')
-rw-r--r-- | test/irb/test_context.rb | 6 |
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? |