Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test_parse_method_bracket #463

Merged
merged 1 commit into from
Jul 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/test_rdoc_parser_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,28 @@ def test_parse_method
assert_equal stream, foo.token_stream
end

def test_parse_method_bracket
util_parser <<-RUBY
class C
def [] end
def self.[] end
def []= end
def self.[]= end
end
RUBY

@parser.scan

c = @store.find_class_named 'C'

assert_equal 4, c.method_list.size
assert_equal 'C#[]', c.method_list[0].full_name
assert_equal 'C::[]', c.method_list[1].full_name
assert_equal 'C#[]=', c.method_list[2].full_name
assert_equal 'C::[]=', c.method_list[3].full_name
assert c.aliases.empty?
end

def test_parse_method_alias
klass = RDoc::NormalClass.new 'Foo'
klass.parent = @top_level
Expand Down