ruby-changes:51201
From: nobu <ko1@a...>
Date: Sat, 12 May 2018 18:09:29 +0900 (JST)
Subject: [ruby-changes:51201] nobu:r63408 (trunk): fix TestInputMethod
nobu 2018-05-12 18:09:23 +0900 (Sat, 12 May 2018) New Revision: 63408 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63408 Log: fix TestInputMethod * test/irb/test_context.rb (TestInputMethod#initialize): fix typos and increment `line_no` only when not reaching the end. Modified files: trunk/test/irb/test_context.rb Index: test/irb/test_context.rb =================================================================== --- test/irb/test_context.rb (revision 63407) +++ test/irb/test_context.rb (revision 63408) @@ -7,16 +7,16 @@ require 'rubygems' if defined?(Gem) https://github.com/ruby/ruby/blob/trunk/test/irb/test_context.rb#L7 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? -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/