Search in sources :

Example 1 with MemberChooserObjectBase

use of com.intellij.codeInsight.generation.MemberChooserObjectBase in project intellij-plugins by JetBrains.

the class RubyMotionOverrideTest method doTest.

private void doTest(@NotNull final String name, @NotNull final String result) throws Exception {
    final Symbol controller = SymbolUtil.findSymbol(getProject(), Type.CLASS, "TestController", null);
    assertNotNull(controller);
    final List<ClassMember> list = RubyOverrideHandler.createOverrideMembers(controller, myFixture.getFile());
    final StringBuilder namesInClass = new StringBuilder();
    for (ClassMember classMember : list) {
        MemberChooserObjectBase methodMember = (MemberChooserObjectBase) classMember;
        if (name.equals(methodMember.getText())) {
            final PsiElement element = OverriddenMethodGenerator.generate(classMember, LanguageLevel.RUBY19);
            assertNotNull(element);
            namesInClass.append(element.getText()).append("\n");
        }
    }
    assertEquals(result, namesInClass.toString().trim());
}
Also used : MemberChooserObjectBase(com.intellij.codeInsight.generation.MemberChooserObjectBase) Symbol(org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.structure.Symbol) ClassMember(com.intellij.codeInsight.generation.ClassMember) PsiElement(com.intellij.psi.PsiElement)

Aggregations

ClassMember (com.intellij.codeInsight.generation.ClassMember)1 MemberChooserObjectBase (com.intellij.codeInsight.generation.MemberChooserObjectBase)1 PsiElement (com.intellij.psi.PsiElement)1 Symbol (org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.structure.Symbol)1