void () { myFixture.configureByText("A.groovy", "\nclass A {\n void foo() {}\n\n void testSomething() {\n def xml = new groovy.xml.MarkupBuilder()\n xml.records() {\n foo<caret>()\n }\n }\n}\n"); PsiElement method = myFixture.getElementAtCaret(); assert method instanceof GrMethodImpl; assert method.isPhysical(); assert ((GrMethodImpl)method).getContainingClass().getName().equals("A"); }