summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/command_set_spec.rb7
-rw-r--r--spec/config_spec.rb4
2 files changed, 8 insertions, 3 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')
diff --git a/spec/config_spec.rb b/spec/config_spec.rb
index db91f7cb..f1cf5ea6 100644
--- a/spec/config_spec.rb
+++ b/spec/config_spec.rb
@@ -150,8 +150,8 @@ RSpec.describe Pry::Config do
end
context "when invoked method is not an option" do
- it "raises NoMethodError" do
- expect { subject.foo }.to raise_error(NoMethodError)
+ it "returns nil" do
+ expect(subject.foo).to be_nil
end
end