mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@d01709f
This commit is contained in:
parent
a319d3cfdc
commit
4ee1a68776
32 changed files with 471 additions and 50 deletions
|
@ -58,6 +58,24 @@ ruby_version_is "3.0" do
|
|||
m(kw: 1).should == []
|
||||
-> { m(kw: 1, kw2: 2) }.should raise_error(ArgumentError, 'unknown keyword: :kw2')
|
||||
-> { m(kw: 1, true => false) }.should raise_error(ArgumentError, 'unknown keyword: true')
|
||||
-> { m(kw: 1, a: 1, b: 2, c: 3) }.should raise_error(ArgumentError, 'unknown keywords: :a, :b, :c')
|
||||
end
|
||||
|
||||
it "raises ArgumentError exception when required keyword argument is not passed" do
|
||||
def m(a:, b:, c:)
|
||||
[a, b, c]
|
||||
end
|
||||
|
||||
-> { m(a: 1, b: 2) }.should raise_error(ArgumentError, /missing keyword: :c/)
|
||||
-> { m() }.should raise_error(ArgumentError, /missing keywords: :a, :b, :c/)
|
||||
end
|
||||
|
||||
it "raises ArgumentError for missing keyword arguments even if there are extra ones" do
|
||||
def m(a:)
|
||||
a
|
||||
end
|
||||
|
||||
-> { m(b: 1) }.should raise_error(ArgumentError, /missing keyword: :a/)
|
||||
end
|
||||
|
||||
it "handle * and ** at the same call site" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue