Skip to content

Commit bd772b8

Browse files
herwinweregon
authored andcommitted
Add spec for delegation with additional arguments
This results in the `Prism::ForwardingArgumentsNode` which is currently not covered in the specs.
1 parent 91ab714 commit bd772b8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

language/delegation_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ def delegate(...)
3737
a.new.delegate(1, b: 2, &block).should == [[1], {b: 2}, block]
3838
end
3939

40+
it "delegates with additional arguments" do
41+
a = Class.new(DelegationSpecs::Target)
42+
a.class_eval(<<-RUBY)
43+
def delegate(...)
44+
target(:first, :second, ...)
45+
end
46+
RUBY
47+
a.new.delegate(1, b: 2).should == [[:first, :second, 1], {b: 2}, nil]
48+
end
49+
4050
it "parses as open endless Range when brackets are omitted" do
4151
a = Class.new(DelegationSpecs::Target)
4252
suppress_warning do

0 commit comments

Comments
 (0)