From bf28115fb64c752977760d54bbd7537f644021f4 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 29 Aug 2024 17:41:16 +0900 Subject: [PATCH] Skip show_doc tests if RDoc is not available --- test/irb/test_command.rb | 2 +- test/irb/test_input_method.rb | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/irb/test_command.rb b/test/irb/test_command.rb index 567c3216c..69931e3e4 100644 --- a/test/irb/test_command.rb +++ b/test/irb/test_command.rb @@ -765,7 +765,7 @@ def test_show_doc 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 9d0f393ce..915297f56 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 @@ def has_rdoc_content? File.exist?(RDoc::RI::Paths::BASE) end end -end +end if defined?(RDoc)