1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-08-21 22:01:34 +00:00
parent 2aefb19888
commit b448f23e21
6 changed files with 51 additions and 56 deletions

View file

@ -511,6 +511,15 @@ describe "A method" do
m(2).should == 2
end
evaluate <<-ruby do
def m() end
ruby
m().should be_nil
m(*[]).should be_nil
m(**{}).should be_nil
end
evaluate <<-ruby do
def m(*) end
ruby
@ -527,6 +536,8 @@ describe "A method" do
m().should == []
m(1).should == [1]
m(1, 2, 3).should == [1, 2, 3]
m(*[]).should == []
m(**{}).should == []
end
evaluate <<-ruby do
@ -561,6 +572,8 @@ describe "A method" do
m().should == {}
m(a: 1, b: 2).should == { a: 1, b: 2 }
m(*[]).should == {}
m(**{}).should == {}
lambda { m(2) }.should raise_error(ArgumentError)
end