aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/shared/basicobject/send.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/shared/basicobject/send.rb')
-rw-r--r--spec/ruby/shared/basicobject/send.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/shared/basicobject/send.rb b/spec/ruby/shared/basicobject/send.rb
index f8c63c5522..2b79ab4c2c 100644
--- a/spec/ruby/shared/basicobject/send.rb
+++ b/spec/ruby/shared/basicobject/send.rb
@@ -29,6 +29,13 @@ describe :basicobject_send, shared: true do
SendSpecs::Foo.send(@method, :bar).should == 'done'
end
+ it "raises a TypeError if the method name is not a string or symbol" do
+ -> { SendSpecs.send(@method, nil) }.should raise_error(TypeError, /not a symbol nor a string/)
+ -> { SendSpecs.send(@method, 42) }.should raise_error(TypeError, /not a symbol nor a string/)
+ -> { SendSpecs.send(@method, 3.14) }.should raise_error(TypeError, /not a symbol nor a string/)
+ -> { SendSpecs.send(@method, true) }.should raise_error(TypeError, /not a symbol nor a string/)
+ end
+
it "raises a NameError if the corresponding method can't be found" do
class SendSpecs::Foo
def bar