mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@ac878ad
This commit is contained in:
parent
f0bfa266d7
commit
f02d2f82bf
17 changed files with 214 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue