ruby-changes:74265
From: Peter <ko1@a...>
Date: Thu, 27 Oct 2022 00:13:59 +0900 (JST)
Subject: [ruby-changes:74265] 73a0223f95 (master): [ruby/irb] Rename test_helper.rb to helper.rb
https://git.ruby-lang.org/ruby.git/commit/?id=73a0223f95 From 73a0223f952ef40d4986dde65eadb8f0b59521f2 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Wed, 26 Oct 2022 11:12:32 -0400 Subject: [ruby/irb] Rename test_helper.rb to helper.rb The name test_helper.rb conflicts with the test_helper.rb in JSON, causing build failures. This commit renames test_helper.rb to helper.rb. https://github.com/ruby/irb/commit/b6a92bf6b3 Co-Authored-By: Stan Lo <stan001212@g...> --- test/irb/helper.rb | 16 ++++++++++++++++ test/irb/test_cmd.rb | 2 +- test/irb/test_helper.rb | 16 ---------------- test/irb/test_input_method.rb | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 test/irb/helper.rb delete mode 100644 test/irb/test_helper.rb diff --git a/test/irb/helper.rb b/test/irb/helper.rb new file mode 100644 index 0000000000..19c39a4a59 --- /dev/null +++ b/test/irb/helper.rb @@ -0,0 +1,16 @@ https://github.com/ruby/ruby/blob/trunk/test/irb/helper.rb#L1 +module IRB + module TestHelper + def self.without_rdoc(&block) + ::Kernel.send(:alias_method, :old_require, :require) + + ::Kernel.define_method(:require) do |name| + raise LoadError, "cannot load such file -- rdoc (test)" if name.match?("rdoc") || name.match?(/^rdoc\/.*/) + ::Kernel.send(:old_require, name) + end + + yield + ensure + EnvUtil.suppress_warning { ::Kernel.send(:alias_method, :require, :old_require) } + end + end +end diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb index 6ff2afc3e3..69830c061b 100644 --- a/test/irb/test_cmd.rb +++ b/test/irb/test_cmd.rb @@ -3,7 +3,7 @@ require "test/unit" https://github.com/ruby/ruby/blob/trunk/test/irb/test_cmd.rb#L3 require "irb" require "irb/extend-command" -require_relative "test_helper" +require_relative "helper" module TestIRB class ExtendCommand < Test::Unit::TestCase diff --git a/test/irb/test_helper.rb b/test/irb/test_helper.rb deleted file mode 100644 index 19c39a4a59..0000000000 --- a/test/irb/test_helper.rb +++ /dev/null @@ -1,16 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/test/irb/test_cmd.rb#L0 -module IRB - module TestHelper - def self.without_rdoc(&block) - ::Kernel.send(:alias_method, :old_require, :require) - - ::Kernel.define_method(:require) do |name| - raise LoadError, "cannot load such file -- rdoc (test)" if name.match?("rdoc") || name.match?(/^rdoc\/.*/) - ::Kernel.send(:old_require, name) - end - - yield - ensure - EnvUtil.suppress_warning { ::Kernel.send(:alias_method, :require, :old_require) } - end - end -end diff --git a/test/irb/test_input_method.rb b/test/irb/test_input_method.rb index 3618fa46f1..90d6bf5364 100644 --- a/test/irb/test_input_method.rb +++ b/test/irb/test_input_method.rb @@ -3,7 +3,7 @@ https://github.com/ruby/ruby/blob/trunk/test/irb/test_input_method.rb#L3 require "test/unit" require "irb" -require_relative "test_helper" +require_relative "helper" module TestIRB class TestRelineInputMethod < Test::Unit::TestCase -- cgit v1.2.3 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/