class RubyIndexer::ClassesAndModulesTest

def test_dynamic_singleton_class_blocks

def test_dynamic_singleton_class_blocks
  index(<<~RUBY)
    class Foo
      # Some extra comments
      class << bar
      end
    end
  RUBY
  singleton = @index["Foo::<Class:bar>"] #: as !nil
    .first #: as Entry::SingletonClass
  # Even though this is not correct, we consider any dynamic singleton class block as a regular singleton class.
  # That pattern cannot be properly analyzed statically and assuming that it's always a regular singleton simplifies
  # the implementation considerably.
  assert_equal(3, singleton.location.start_line)
  assert_equal("Some extra comments", singleton.comments)
end