[前][次][番号順一覧][スレッド一覧]

ruby-changes:59780

From: aycabta <ko1@a...>
Date: Thu, 23 Jan 2020 13:37:49 +0900 (JST)
Subject: [ruby-changes:59780] 890200e85e (master): Check DONT_RUN_RELINE_TEST envvar

https://git.ruby-lang.org/ruby.git/commit/?id=890200e85e

From 890200e85e5237d9656a6b72e792effbcaa5460a Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Tue, 3 Dec 2019 12:54:24 +0900
Subject: Check DONT_RUN_RELINE_TEST envvar


diff --git a/test/readline/helper.rb b/test/readline/helper.rb
index ee15772..d5f0257 100644
--- a/test/readline/helper.rb
+++ b/test/readline/helper.rb
@@ -3,18 +3,20 @@ begin https://github.com/ruby/ruby/blob/trunk/test/readline/helper.rb#L3
   ReadlineSo = Readline
 rescue LoadError
 end
-require "reline"
 
 def use_ext_readline # Use ext/readline as Readline
   Object.send(:remove_const, :Readline) if Object.const_defined?(:Readline)
   Object.const_set(:Readline, ReadlineSo)
 end
 
-def use_lib_reline # Use lib/reline as Readline
-  Reline.send(:remove_const, 'IOGate') if Reline.const_defined?('IOGate')
-  Reline.const_set('IOGate', Reline::GeneralIO)
-  Reline.send(:core).config.instance_variable_set(:@test_mode, true)
-  Reline.send(:core).config.reset
-  Object.send(:remove_const, :Readline) if Object.const_defined?(:Readline)
-  Object.const_set(:Readline, Reline)
+unless ENV['DONT_RUN_RELINE_TEST']
+  require "reline"
+  def use_lib_reline # Use lib/reline as Readline
+    Reline.send(:remove_const, 'IOGate') if Reline.const_defined?('IOGate')
+    Reline.const_set('IOGate', Reline::GeneralIO)
+    Reline.send(:core).config.instance_variable_set(:@test_mode, true)
+    Reline.send(:core).config.reset
+    Object.send(:remove_const, :Readline) if Object.const_defined?(:Readline)
+    Object.const_set(:Readline, Reline)
+  end
 end
diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb
index 4519772..d2e2cdd 100644
--- a/test/readline/test_readline.rb
+++ b/test/readline/test_readline.rb
@@ -799,4 +799,4 @@ class TestRelineAsReadline < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L799
       super
     end
   end
-end
+end if defined?(Reline)
diff --git a/test/readline/test_readline_history.rb b/test/readline/test_readline_history.rb
index 509f1d6..98fef65 100644
--- a/test/readline/test_readline_history.rb
+++ b/test/readline/test_readline_history.rb
@@ -283,4 +283,4 @@ class TestRelineAsReadlineHistory < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline_history.rb#L283
       super
     end
   end
-end
+end if defined?(Reline)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]