Skip to content

Commit

Permalink
Add test demonstrating name error
Browse files Browse the repository at this point in the history
  • Loading branch information
latortuga committed May 30, 2023
1 parent 2200945 commit 8a8298c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test_ripper_tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -846,4 +846,19 @@ def included_method; end
expected = ["Object#test_method", "M", "M#included_method", "M#cache", "M#cache="]
assert_equal expected, tags.map { |t| t[:full_name] }
end

def test_multi_argument_delegate
tags = extract(<<-EOC)
class C
def object = Object.new
delegate :thing, :other, to: :object
%i(test).each do |m|
delegate m, :"\#{m}=", to: :object
end
end
EOC

expected = ["C", "C#object", "C#thing", "C#other", "C#test", "C#test="].sort
assert_equal expected, tags.map { |t| t[:full_name] }.sort
end
end

0 comments on commit 8a8298c

Please sign in to comment.