summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2024-08-29 17:41:16 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-09-01 20:00:13 +0900
commiteb144ef91e0b7f01cbe915bac2ac29bd532e1c28 (patch)
tree243c6882f996509247f31c0785982a0fb01d77cd
parent4aa3491bd235fd16fbef7ba24181bc838aa29abb (diff)
Skip show_doc tests if RDoc is not available
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11491
-rw-r--r--test/irb/test_command.rb2
-rw-r--r--test/irb/test_input_method.rb7
2 files changed, 6 insertions, 3 deletions
diff --git a/test/irb/test_command.rb b/test/irb/test_command.rb
index 567c3216cc..69931e3e4f 100644
--- a/test/irb/test_command.rb
+++ b/test/irb/test_command.rb
@@ -765,7 +765,7 @@ module TestIRB
ensure
# this is the only way to reset the redefined method without coupling the test with its implementation
EnvUtil.suppress_warning { load "irb/command/help.rb" }
- end
+ end if defined?(RDoc)
def test_show_doc_without_rdoc
_, err = without_rdoc do
diff --git a/test/irb/test_input_method.rb b/test/irb/test_input_method.rb
index 9d0f393ce0..915297f56c 100644
--- a/test/irb/test_input_method.rb
+++ b/test/irb/test_input_method.rb
@@ -1,7 +1,10 @@
# frozen_string_literal: false
require "irb"
-require "rdoc"
+begin
+ require "rdoc"
+rescue LoadError
+end
require_relative "helper"
module TestIRB
@@ -188,4 +191,4 @@ module TestIRB
File.exist?(RDoc::RI::Paths::BASE)
end
end
-end
+end if defined?(RDoc)