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@66041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-11-27 20:38:57 +00:00
parent 49cd16bfaf
commit 50441014ff
102 changed files with 771 additions and 426 deletions

View file

@ -1269,7 +1269,7 @@ describe "A method" do
def m(a, b = nil, c = nil, d, e: nil, **f)
[a, b, c, d, e, f]
end
ruby
ruby
result = m(1, 2)
result.should == [1, nil, nil, 2, nil, {}]
@ -1281,6 +1281,19 @@ describe "A method" do
result.should == [1, nil, nil, {foo: :bar}, nil, {}]
end
end
context "assigns keyword arguments from a passed Hash without modifying it" do
evaluate <<-ruby do
def m(a: nil); a; end
ruby
options = {a: 1}.freeze
lambda do
m(options).should == 1
end.should_not raise_error
options.should == {a: 1}
end
end
end
describe "A method call with a space between method name and parentheses" do