summaryrefslogtreecommitdiff
path: root/spec/code_spec.rb
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2019-03-23 15:50:57 +0200
committerKyrylo Silin <silin@kyrylo.org>2019-03-23 15:50:57 +0200
commit0c0b171486cbcea87f0e6bce833a2cbdfde46686 (patch)
treee76e7d59ce83d64de8012da38ab3fe9f5cbbb8d5 /spec/code_spec.rb
parent082691eb90b33a9deff808af1c09198975e6c106 (diff)
downloadpry-0c0b171486cbcea87f0e6bce833a2cbdfde46686.tar.gz
rubocop: fix offences of the Style/MethodMissingSuper cop
Diffstat (limited to 'spec/code_spec.rb')
-rw-r--r--spec/code_spec.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/code_spec.rb b/spec/code_spec.rb
index 074d8f0d..0d2c2d4d 100644
--- a/spec/code_spec.rb
+++ b/spec/code_spec.rb
@@ -501,9 +501,17 @@ RSpec.describe Pry::Code do
end
describe "#method_missing" do
- it "forwards any missing methods to the output of '#to_s'" do
- expect(subject).to receive_message_chain(:to_s, :send)
- subject.abcdefg
+ context "when a String responds to the given method" do
+ it "forwards the method to a String instance" do
+ expect(subject.upcase).to eq('')
+ end
+ end
+
+ context "when a String does not respond to the given method" do
+ it "raises NoMethodError" do
+ expect { subject.abcdefg }
+ .to raise_error(NoMethodError, /undefined method `abcdefg'/)
+ end
end
end