diff options
author | Benoit Daloze <[email protected]> | 2020-11-27 14:55:31 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-11-27 14:55:31 +0100 |
commit | f02d2f82bf10351f480ea312f40cb840e2437f93 (patch) | |
tree | 0b53098bffe6dacadb09880183ebcaea06e95153 /spec/ruby/language/block_spec.rb | |
parent | f0bfa266d70651dc295a63b026938b246693499b (diff) |
Update to ruby/spec@ac878ad
Diffstat (limited to 'spec/ruby/language/block_spec.rb')
-rw-r--r-- | spec/ruby/language/block_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/ruby/language/block_spec.rb b/spec/ruby/language/block_spec.rb index 45a8ec5f9a..b2a3cc84c4 100644 --- a/spec/ruby/language/block_spec.rb +++ b/spec/ruby/language/block_spec.rb @@ -873,7 +873,7 @@ describe "Post-args" do end.call(1, 2, 3).should == [[], 1, 2, 3] end - it "are required" do + it "are required for a lambda" do -> { -> *a, b do [a, b] @@ -881,6 +881,12 @@ describe "Post-args" do }.should raise_error(ArgumentError) end + it "are assigned to nil when not enough arguments are given to a proc" do + proc do |a, *b, c| + [a, b, c] + end.call.should == [nil, [], nil] + end + describe "with required args" do it "gathers remaining args in the splat" do |