Skip to content

Add test for scan visibility count #459

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

Merged
merged 1 commit into from
Jul 11, 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
27 changes: 27 additions & 0 deletions test/test_rdoc_parser_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3277,6 +3277,33 @@ def b() end
assert c_b.singleton
end

def test_scan_visibility_count
util_parser <<-RUBY
class C < Original::Base
class C2 < Original::Base
def m0() end
def m1() end

private

def m2() end
def m3() end
def m4() end
end
end
RUBY

@parser.scan

c = @store.find_class_named 'C::C2'

private_method_count = c.method_list.count { |m| :private == m.visibility }
assert_equal 3, private_method_count

public_method_count = c.method_list.count { |m| :public == m.visibility }
assert_equal 2, public_method_count
end

def test_singleton_method_via_eigenclass
util_parser <<-RUBY
class C
Expand Down