summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStan Lo <stan001212@gmail.com>2023-11-26 17:07:41 +0000
committergit <svn-admin@ruby-lang.org>2023-11-26 17:07:45 +0000
commitcc5d1bf026bcc5b4929a4f9d5e32d2fa5730348c (patch)
tree44175f94844752733019e6f5445d249a614e42e5 /test
parent688faa93f03142b632b8eb0de0946f4e86845ebc (diff)
[ruby/irb] Display aliases in help message
(https://github.com/ruby/irb/pull/788) Similar to Pry, it displays user-defined aliases in the help message with a dedicated section. With the current default aliases, it looks like: ``` ...other sections... Aliases $ Alias for `show_source` @ Alias for `whereami` ``` https://github.com/ruby/irb/commit/2a0eacc891
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_cmd.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb
index 62ef7a5b70..55373c2e8a 100644
--- a/test/irb/test_cmd.rb
+++ b/test/irb/test_cmd.rb
@@ -680,6 +680,16 @@ module TestIRB
assert_match(/List all available commands and their description/, out)
assert_match(/Start the debugger of debug\.gem/, out)
end
+
+ def test_show_cmds_list_user_aliases
+ out, err = execute_lines(
+ "show_cmds\n"
+ )
+
+ assert_empty err
+ assert_match(/\$\s+Alias for `show_source`/, out)
+ assert_match(/@\s+Alias for `whereami`/, out)
+ end
end
class LsTest < CommandTestCase