summaryrefslogtreecommitdiff
path: root/spec/ruby/language/send_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2019-07-27 12:40:09 +0200
committerBenoit Daloze <[email protected]>2019-07-27 12:40:09 +0200
commit5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch)
tree05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/language/send_spec.rb
parenta06301b103371b0b7da8eaca26ba744961769f99 (diff)
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/language/send_spec.rb')
-rw-r--r--spec/ruby/language/send_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/ruby/language/send_spec.rb b/spec/ruby/language/send_spec.rb
index 84d02afb82..4ba3dcc9c2 100644
--- a/spec/ruby/language/send_spec.rb
+++ b/spec/ruby/language/send_spec.rb
@@ -20,7 +20,7 @@ describe "Invoking a method" do
end
it "raises ArgumentError if the method has a positive arity" do
- lambda {
+ -> {
specs.fooM1
}.should raise_error(ArgumentError)
end
@@ -36,7 +36,7 @@ describe "Invoking a method" do
end
it "raises ArgumentError if the methods arity doesn't match" do
- lambda {
+ -> {
specs.fooM1(1,2)
}.should raise_error(ArgumentError)
end
@@ -52,7 +52,7 @@ describe "Invoking a method" do
end
it "raises ArgumentError if extra arguments are passed" do
- lambda {
+ -> {
specs.fooM0O1(2,3)
}.should raise_error(ArgumentError)
end
@@ -64,13 +64,13 @@ describe "Invoking a method" do
end
it "raises an ArgumentError if there are no values for the mandatory args" do
- lambda {
+ -> {
specs.fooM1O1
}.should raise_error(ArgumentError)
end
it "raises an ArgumentError if too many values are passed" do
- lambda {
+ -> {
specs.fooM1O1(1,2,3)
}.should raise_error(ArgumentError)
end
@@ -107,7 +107,7 @@ describe "Invoking a method" do
end
it "raises a SyntaxError with both a literal block and an object as block" do
- lambda {
+ -> {
eval "specs.oneb(10, &l){ 42 }"
}.should raise_error(SyntaxError)
end
@@ -195,20 +195,20 @@ describe "Invoking a method" do
end
it "raises NameError if invoked as a vcall" do
- lambda { no_such_method }.should raise_error NameError
+ -> { no_such_method }.should raise_error NameError
end
it "should omit the method_missing call from the backtrace for NameError" do
- lambda { no_such_method }.should raise_error { |e| e.backtrace.first.should_not include("method_missing") }
+ -> { no_such_method }.should raise_error { |e| e.backtrace.first.should_not include("method_missing") }
end
it "raises NoMethodError if invoked as an unambiguous method call" do
- lambda { no_such_method() }.should raise_error NoMethodError
- lambda { no_such_method(1,2,3) }.should raise_error NoMethodError
+ -> { no_such_method() }.should raise_error NoMethodError
+ -> { no_such_method(1,2,3) }.should raise_error NoMethodError
end
it "should omit the method_missing call from the backtrace for NoMethodError" do
- lambda { no_such_method() }.should raise_error { |e| e.backtrace.first.should_not include("method_missing") }
+ -> { no_such_method() }.should raise_error { |e| e.backtrace.first.should_not include("method_missing") }
end
end
@@ -260,8 +260,8 @@ end
describe "Invoking a private getter method" do
it "does not permit self as a receiver" do
receiver = LangSendSpecs::PrivateGetter.new
- lambda { receiver.call_self_foo }.should raise_error(NoMethodError)
- lambda { receiver.call_self_foo_or_equals(6) }.should raise_error(NoMethodError)
+ -> { receiver.call_self_foo }.should raise_error(NoMethodError)
+ -> { receiver.call_self_foo_or_equals(6) }.should raise_error(NoMethodError)
end
end