diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2020-04-12 15:17:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-12 15:17:32 +0800 |
commit | 7a4166fb04e077536b7b8931c2649a0985cf1a83 (patch) | |
tree | 9e4efe5886e2693d0dea07ef4dfc971278bb5343 /spec | |
parent | 9094b5f8d47e61c1cf64ac07847d46b09e7ef932 (diff) | |
parent | a164846c4dc69386432a19a684ea64c2a9e737b5 (diff) | |
download | pry-7a4166fb04e077536b7b8931c2649a0985cf1a83.tar.gz |
Merge pull request #2120 from barrettkingram/fix-help-command-listing
Improve appearance of help command listing
Diffstat (limited to 'spec')
-rw-r--r-- | spec/command_set_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/command_set_spec.rb b/spec/command_set_spec.rb index fc67d140..c5243999 100644 --- a/spec/command_set_spec.rb +++ b/spec/command_set_spec.rb @@ -185,11 +185,16 @@ RSpec.describe Pry::CommandSet do expect(new_command.description).to eq('Alias for `test`') end - it "sets aliased command's listing" do + it "sets aliased command's listing for string alias" do new_command = subject.alias_command('new-test', 'test') expect(new_command.options).to include(listing: 'new-test') end + it "sets aliased command's listing for regex alias" do + new_command = subject.alias_command(/test[!?]+/, 'test') + expect(new_command.options[:listing].to_s).to eq('/test[!?]+/') + end + it "sets group for the aliased command automatically" do new_command = subject.alias_command('new-test', 'test') expect(new_command.group).to eq('Aliases') |