summaryrefslogtreecommitdiff
path: root/spec/ruby/core/proc/shared/call.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/proc/shared/call.rb')
-rw-r--r--spec/ruby/core/proc/shared/call.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/ruby/core/proc/shared/call.rb b/spec/ruby/core/proc/shared/call.rb
index c30ea84b23..fae2331b68 100644
--- a/spec/ruby/core/proc/shared/call.rb
+++ b/spec/ruby/core/proc/shared/call.rb
@@ -49,6 +49,9 @@ describe :proc_call_on_proc_or_lambda, shared: true do
a = proc {|x| x}.send(@method, 1, 2, 3)
a.should == 1
+
+ a = proc {|x:| x}.send(@method, 2, x: 1)
+ a.should == 1
end
it "will call #to_ary on argument and return self if return is nil" do
@@ -67,21 +70,21 @@ describe :proc_call_on_proc_or_lambda, shared: true do
it "raises an ArgumentError on excess arguments when self is a lambda" do
-> {
-> x { x }.send(@method, 1, 2)
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
-> {
-> x { x }.send(@method, 1, 2, 3)
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
end
it "raises an ArgumentError on missing arguments when self is a lambda" do
-> {
-> x { x }.send(@method)
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
-> {
-> x, y { [x,y] }.send(@method, 1)
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
end
it "treats a single Array argument as a single argument when self is a lambda" do