summaryrefslogtreecommitdiff
path: root/test/irb
diff options
context:
space:
mode:
authorStan Lo <stan.lo@shopify.com>2022-12-12 17:35:43 +0000
committergit <svn-admin@ruby-lang.org>2022-12-12 17:35:48 +0000
commit223d4448c827b9daeb6a61312777e67405e66379 (patch)
tree852479c3f432849351c09700e45bb983a6a6d52e /test/irb
parentece624605785f6640118a0cfd97618e71abfbee8 (diff)
[ruby/irb] `show_doc` command should take non-string argument too
(https://github.com/ruby/irb/pull/478) Given that `show_doc` already supports syntax like `String#gsub`, it should be able to take it in non-string form too, like `edit` and `show_source` do. This ensures users can have a consistent syntax on argument between different commands.
Diffstat (limited to 'test/irb')
-rw-r--r--test/irb/test_cmd.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb
index d4b952490d..3602b7c331 100644
--- a/test/irb/test_cmd.rb
+++ b/test/irb/test_cmd.rb
@@ -379,13 +379,13 @@ module TestIRB
def test_help_and_show_doc
["help", "show_doc"].each do |cmd|
out, _ = execute_lines(
- "#{cmd} 'String#gsub'\n",
+ "#{cmd} String#gsub\n",
"\n",
)
# the former is what we'd get without document content installed, like on CI
# the latter is what we may get locally
- possible_rdoc_output = [/Nothing known about String#gsub/, /Returns a copy of self with all occurrences of the given pattern/]
+ possible_rdoc_output = [/Nothing known about String#gsub/, /str.gsub\(pattern\)/]
assert(possible_rdoc_output.any? { |output| output.match?(out) }, "Expect the `#{cmd}` command to match one of the possible outputs")
end
ensure